Here is some sample code for authenticating against an SMTP server. You could just set up your own Virtual SMTP server for testing purposes and not have to worry about authenticating just yet. Someone else has replied with a useful link for that already. Here is the code: System.Web.Mail.MailMessage ms = new System.Web.Mail.MailMessage(); ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "myUsername"); ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "myPassword"); ms.To = "you@yourcompanyaaaxxx.com"; ms.From = "me@mycompanyaaaxxx.com"; ms.Subject = "test message"; ms.Body = "the body of my message"; System.Web.Mail.SmtpMail.SmtpServer = "mail.mycompanyaaaxxx.com"; System.Web.Mail.SmtpMail.Send(ms); HTH Nick
N
NFinch
@NFinch
Posts
-
{"Could not access 'CDO.Message' object." } -
Managed DirectXI have just started trying my hand at DirectX. Have you installed the SDK Update from... http://www.microsoft.com/downloads/details.aspx?FamilyId=9216652F-51E0-402E-B7B5-FEB68D00F298&displaylang=en
-
{"Could not access 'CDO.Message' object." }mmm, yes I have had this before. It is a default message when calling the SmtpMail.Send method. Have you added any attachements to the message, if so, make sure that they are accessible! Make sure that you are specifiying a valid SMTP server. Does the SMTP server require authentication?