From: Tom Shelton on
On 2010-04-27, Mayayana <mayayana(a)invalid.nospam> wrote:
>
>| Is there any way to send an email (either from a VB program or ASP or
> HTML)
>| if the machine has no Outlook and/or SMTP server ?
>| Thank you
>|

<SNIP>

> If you need VB.Net code...I have no idea. One would
> hope that it's somewhere in that 300+MB of runtime
> baggage, without needing to install Outlook.

Option Strict On
Option Explicit On

Imports System
Imports System.Net
Imports System.Net.Mail

Module Module1

Sub Main()
Using msg As New MailMessage

With msg
.From = New MailAddress("somebody(a)someplace.com")
.To.Add(New MailAddress("someotherbody(a)someotherplace.com"))
.Subject = "some subject"
.Body = "Hey there!"
End With

Dim smtp As New SmtpClient("my.mail.server.net")
' assuming your server requires authentication...
smtp.Credentials = New NetworkCredential("myusername", "mypassword")
smtp.Send(msg)

End Using
End Sub

End Module


--
Tom Shelton
From: Michel Posseth [MCP] on

I once wrote a VB6 catalogue program that had the ability to place orders
that had to be send to a e-mail adress of a reseller
after strugling with lots of methods ( registry etc etc ) to get the local
SMTP server and at one point running into a big problem where the users had
a Lotus Domino system i found out that it was much easier to send a form
posting over HTTP to a server that i controled and generate the e-mail from
there
to be send to the order department of the company where i wrote the program
for .

I then only needed the local email adress so the order department could
optionally reply to the placed order

Hope this helps

Michel



"fniles" <fniles(a)pfmail.com> schreef in bericht
news:%232DBO1W5KHA.620(a)TK2MSFTNGP02.phx.gbl...
> Is there any way to send an email (either from a VB program or ASP or
> HTML) if the machine has no Outlook and/or SMTP server ?
> Thank you
>

From: Tom Shelton on
On 2010-04-27, Michel Posseth [MCP] <msdn(a)posseth.com> wrote:
>
> I once wrote a VB6 catalogue program that had the ability to place orders
> that had to be send to a e-mail adress of a reseller
> after strugling with lots of methods ( registry etc etc ) to get the local
> SMTP server and at one point running into a big problem where the users had
> a Lotus Domino system i found out that it was much easier to send a form
> posting over HTTP to a server that i controled and generate the e-mail from
> there
> to be send to the order department of the company where i wrote the program
> for .
>
> I then only needed the local email adress so the order department could
> optionally reply to the placed order
>
> Hope this helps
>
> Michel
>

I could see that in the old days - but, really how many companies don't have
email now a days? Even a small company is going to have an email account -
all you need to know is the server address and the login info to send an
email. smtp is a very simple protocol.

--
Tom Shelton
From: Michel Posseth [MCP] on

Well the program i wrote was installed from a cd-rom ( DVD in a later
stage ) and had to function "out of the box"
and i bet not a lot of people ( end consumers ) know there e-mail settings
so i guess the same aplies as of today

Also you forget about the Lotus Domino situation or if there is a Outlook
server installed on a company network
( for a fact i never got Lotus to work )

So in these sitautions my solution was / is just fool proof and verry
simple to implement

>smtp is a very simple protocol.

For VB6 i used the VBSendmail.dll and in .Net you can just use the builtin
framework classes however they are perfect in a "simple" situation
even on a MS Exchange network it will not work if SMTP is closed on the mail
server ( this is default on Exchange ) , for a fact in the company i
currently work for we have a Linux mail server especially for our .Net apps
as the admins want to keep the "recomended" settings on the Exchange server
..


regards

Michel




"Tom Shelton" <tom_shelton(a)comcastXXXXXXX.net> schreef in bericht
news:%23MfI%23vj5KHA.5464(a)TK2MSFTNGP05.phx.gbl...
> On 2010-04-27, Michel Posseth [MCP] <msdn(a)posseth.com> wrote:
>>
>> I once wrote a VB6 catalogue program that had the ability to place orders
>> that had to be send to a e-mail adress of a reseller
>> after strugling with lots of methods ( registry etc etc ) to get the
>> local
>> SMTP server and at one point running into a big problem where the users
>> had
>> a Lotus Domino system i found out that it was much easier to send a form
>> posting over HTTP to a server that i controled and generate the e-mail
>> from
>> there
>> to be send to the order department of the company where i wrote the
>> program
>> for .
>>
>> I then only needed the local email adress so the order department could
>> optionally reply to the placed order
>>
>> Hope this helps
>>
>> Michel
>>
>
> I could see that in the old days - but, really how many companies don't
> have
> email now a days? Even a small company is going to have an email
> account -
> all you need to know is the server address and the login info to send an
> email. smtp is a very simple protocol.
>
> --
> Tom Shelton

From: Tom Shelton on
On 2010-04-27, Michel Posseth [MCP] <msdn(a)posseth.com> wrote:
>
> Well the program i wrote was installed from a cd-rom ( DVD in a later
> stage ) and had to function "out of the box"
> and i bet not a lot of people ( end consumers ) know there e-mail settings
> so i guess the same aplies as of today
>

And yet, they manage to get their outlook working... I'm willing to bet that
the guy that installs the software also knows the corporate email settings.
But, you know your users. Your way probably was best for your situation.

> Also you forget about the Lotus Domino situation or if there is a Outlook
> server installed on a company network
> ( for a fact i never got Lotus to work )
>
> So in these sitautions my solution was / is just fool proof and verry
> simple to implement
>
>>smtp is a very simple protocol.
>
> For VB6 i used the VBSendmail.dll and in .Net you can just use the builtin
> framework classes however they are perfect in a "simple" situation
> even on a MS Exchange network it will not work if SMTP is closed on the mail
> server ( this is default on Exchange ) , for a fact in the company i
> currently work for we have a Linux mail server especially for our .Net apps
> as the admins want to keep the "recomended" settings on the Exchange server
> .
>

Hmmm... That's interesting. Not having ever done anything with Exchange
admin, I know nothing about setting it up or configuring it. Or what is
recommended best practice or not. But, I know on every corporate exchange
network I have been on, I have no problems sending emails using the smtp
classes in .NET as long as I set the authentication properly...

--
Tom Shelton