Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending Email via SMTP
Message
From
10/11/2003 15:41:12
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Sending Email via SMTP
Miscellaneous
Thread ID:
00848475
Message ID:
00848475
Views:
51
All,

I have a website that sends vistors email via SMTP. The SMTP service is running on the server, but I am getting an error message when I call the send command of the smtp object. The error message is: "Could not access 'CDO.Message' object". My code is below,

IMPORTS System.web.mail
.....
Private Sub SendEmail()
Dim oMsg As New MailMessage()
Dim strFile1 As String
Dim strFile2 As String

strFile1 = Server.MapPath("mydoc.doc")
strFile2 = Server.MapPath("mydoc2.doc")
Dim oAttchmnt1 As MailAttachment = New MailAttachment(strFile1, MailEncoding.Base64)
Dim oAttchment2 As MailAttachment = New MailAttachment(strFile2, MailEncoding.Base64)

With oMsg
.From = "JimRieck@yahoo.com"
.To = txtEmail.Text
.Subject = ""
.BodyFormat = MailFormat.Text
.Attachments.Add(oAttchmnt1)
.Attachments.Add(oAttchmnt2)
End With
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(oMsg)
End Sub
Thanks

Jim
Next
Reply
Map
View

Click here to load this message in the networking platform