Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending email with SMTP

Status
Not open for further replies.

peekay

Programmer
Oct 11, 1999
324
ZA
I get the following error when using :

SmtpMail.Send(MyMessage)

Could not access 'CDO.Message' object

Can someone help ?

Thanks


PK Odendaal
 
Hi ThatRickGuy

Here is my code :

cmdSelect = New OleDbCommand("SELECT * from clients", dbCn)
drClients = cmdSelect.ExecuteReader()
MyMessage.From = txtFromEmail.Text
MyMessage.Subject = txtSubject.Text
MyMessage.Body = txtMessage.Text
MyMessage.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = "mail.witbank.biz"
Do While drClients.Read
drClients.Read()
Clientname = drClients.Item("Clientname").ToString
HisEmail = drClients.Item("email").ToString
MyMessage.To = HisEmail
SmtpMail.Send(MyMessage)
lblNote.Text = "Sending email to " & Clientname
Loop
dbCn.Close()
lblNote.Text = "All email was sent successfully"

PK Odendaal
 
You have to install IIS on any machine which you use to send mail via WebMail, according to something I read recently. I encountered similar problems, and reverted back to sending mail through Outlook.

Outlook is a bit of a pain as the security kicks in every time you try to send a mail, using a developed application, but there is a handy little utility and its freeware called CLICKYES to work around this. It allows you to send a mail without having to click Yes to Outlooks security messages, and is configurable, so you can talk to it in .NET to put it in Suspend or Ready Mode.





Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top