Groups | Blog | Home
all groups > vb.net upgrade > august 2003 >

vb.net upgrade : Can't send mail since upgrade to VS2003


Burt Johnson
8/19/2003 8:26:33 AM
I have a simple command line program that sends mail. I
upgraded from VS.NET to VS.NET2003. Now when my program
runs, I get an error "Could not access 'CDO.Message'
object." Is there a better way to send mail in 2003?

To help troubleshoot, I rewrote a simple Windows form.
Four simple textboxes and a command button. Here is the
code.

Option Explicit On
Imports System.Web.Mail

Public Class Form1
Inherits System.Windows.Forms.Form

Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Dim email As New MailMessage
email.To = TextBox1.Text
email.From = TextBox2.Text
email.Body = TextBox4.Text
email.Subject = TextBox3.Text
email.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = "mail"
SmtpMail.Send(email)

End Sub
Burt Johnson
8/19/2003 9:37:17 AM
Nevermind. I figured it out with more testing. It seems
that if I put the Fully Qualified Domain Name in the
SmtpServer variable, it worked fine. Go figure.

[quoted text, click to view]
AddThis Social Bookmark Button