By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

send mail with VB

P: n/a
Hi,

I got this code from the web, but i can't get it to work. Is there any special setting on my local WinXP machine to make it works? I have enabled the IIS-SMTP Service. Anything else?

Dim mailMsg As New CDO.Message
Dim mailConfig
Set mailConfig = CreateObject("CDO.Configuration")

mailConfig.Fields(edoSMTPServer) = "localhost"
mailConfig.Fields(edoSendUsingMethod) = cdoSendUsingPort
mailConfig.Fields.Update

mailMsg.configuration = mailConfig
mailMsg.To = "ab*@abc.com"
mailMsg.From ="12*@123.com"
mailMsg.Subject = "testing mail"
mailMsg.AddAttachment("c:\Temp\test.txt")
mailMsg.Send
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Wed, 21 Jul 2004 18:35:02 -0700, Roy T wrote:
Hi,

I got this code from the web, but i can't get it to work. Is there any special setting on my local WinXP machine to make it works? I have enabled the IIS-SMTP Service. Anything else?

Dim mailMsg As New CDO.Message
Dim mailConfig
Set mailConfig = CreateObject("CDO.Configuration")

mailConfig.Fields(edoSMTPServer) = "localhost"
mailConfig.Fields(edoSendUsingMethod) = cdoSendUsingPort
mailConfig.Fields.Update

mailMsg.configuration = mailConfig
mailMsg.To = "ab*@abc.com"
mailMsg.From ="12*@123.com"
mailMsg.Subject = "testing mail"
mailMsg.AddAttachment("c:\Temp\test.txt")
mailMsg.Send


With the above code... What doesn't work? Do you get an exception? Does
it just not send? Need more info...

Also, have you looked at System.Web.Mail? To use it you'll need to add a
reference to System.Web.dll to your project.

--
Tom Shelton [MVP]
Nov 20 '05 #2

P: n/a
* "=?Utf-8?B?Um95IFQ=?=" <Ro**@discussions.microsoft.com> scripsit:
I got this code from the web, but i can't get it to work. Is there
any special setting on my local WinXP machine to make it works? I have
enabled the IIS-SMTP Service. Anything else?


Is there a reason why you are not using the classes provided in the
'System.Web.Mail' namespace? For questions on this namespace, take a
look at <URL:http://www.systemwebmail.net/>.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.