Send Email via Exchange using CDOEX.DLL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Could someone please point me to a KB article that shows a VB.NET code
snippet for sending an email message through exchange 2003 or provide a
VB.NET code snippet here in a reply to this question. I have seen a lot of
info on CDOEX.DLL but nothing on how to simply use it to send an email
message in VB.NET using an exchange 2003 server.
Thanks.
 
If you have the MSDN library (online help) installed, check out this URL:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemWebMailSmtpMailClassTopic.htm

If not, search msdn.microsoft.com for "smtpmail"
 
Here is the code to send mail using .NET
Note: if windows application, add reference to System.Web.dll

Dim _MailMessage As New System.Web.Mail.MailMessage
With _MailMessage
.From = "<any valid mail ID>"
.To = <receipent>
.Cc = <>
.Subject = "<subject>"
.Body = "<Message>"
End With

SmtpMail.SmtpServer = "<mail server ip or name>"
SmtpMail.Send(_MailMessage)
 
Back
Top