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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email problem - Using SMTP server from ASP.Net

Status
Not open for further replies.

rushdib

Programmer
Jun 12, 2001
203
US
Hi,
I am new to SMTP mail service. I have installed the SMTP with the IIS 5.0. I have Windows XP and Visual Studio 2003.
When I use the following code to send e-mail

imports system.web.mail
SmtpMail.SmtpServer = "localhost"
'create mail message object
Dim oMessage As New MailMessage
' set some properties
oMessage.BodyFormat = MailFormat.Text
oMessage.From = my email address
oMessage.To = receiver's e-mail address
oMessage.Subject = "Test Mail"
oMessage.Body = "This is a test e-mail, please ignore.\r\rBest regards,\rWimdows.net"
' Send the e-mail
SmtpMail.Send(oMessage)

I get the following message

Could not access 'CDO.Message' object.

Now, I tried without the first line (smtpmail.smtpserver), it still gives me the same message.

When I searched for this error on the web, I found that this is a generic message.

How do I make sure my SMTP server is configured properly?

Can someone please help me?

Thanks in advance,

Rushdi Basir
 
I used to have the same problem and it can be resolved my getting the SMTP configuration from your IT Department. If you are in my situation, i.e. can't get that data very easily, I am certain you have the IP address of your web server, correct? Simply put the IP address there and it works!

Let me know if this helps...
 
Hi,
I tried changing the ip address to my ip This is my local machine. It gives the same error.

Rushdi
 
So I take it you haven't deployed it to your production server right? I haven't tried it on a development box (own computer), but I guess (local) doesn't work.

I'll try to get back to you on this...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top