Click to See Complete Forum and Search --> : mail object


anisha20
May 24th, 2006, 03:04 AM
i have a small code to send mail. In the From and To Object of the message object, if i include
"me@mycompany.com" it gives an error "cdo.object" not found. But if i give it as
"me" then it is sent and i can refer to it in dropmail folder of wwwroot.



The code:
using System.Web.Mail;


MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
SmtpMail.SmtpServer = "localhost"; //your real server goes here
SmtpMail.Send( mail );