Could not access 'CDO.Message' object Error

  • Thread starter Patrick Olurotimi Ige
  • Start date
P

Patrick Olurotimi Ige

But i get Error:-
Could not access 'CDO.Message' object Error

I'm trying to send email using this :-

Dim objEmail as New MailMessage
sBody = "This is our test email to you"
objEmail.Subject="This is my Subject"
Dim MySQL as string = "Select Name, email from TestMail"
Dim MyConn As SqlConnection = New
SqlConnection(ConfigurationSettings.AppSettings("ConfigSettings"))
Dim objDR as SQLDataReader
Dim Cmd as New SQLCommand(MySQL, MyConn)
MyConn.Open()
objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)

While objDR.Read()
sEmail = objDR("email")
objEmail.To =sEmail
objEmail.FROM="(e-mail address removed)"
objEmail.Body=sBody & vbcrlf & "Name: " & objDR("Name") & vbcrlf &
"Email: " & sEmail
objEmail.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer ="mail.MyDomain.com"
SmtpMail.Send(objEmail)
lblEmails.text+=sEmail & "<br>"
End While
MyConn.Close

System.Web.HttpException: Could not access 'CDO.Message' object
 
P

Patrick Olurotimi Ige

Fixed it..
I looked through that page already and thre is alot of info there.
Thanks Sin Min
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top