Saturday, March 24, 2012

SmtpClient questions

Is there a way to make send email using a proxy server with the SmtpClient class?

Thanks,

Khanathor

hi,

hoe code below solves your purpose

MailMessage msg =new MailMessage();

msg.EmailFrom = "test@.axosoft.com";

msg.AddEmailTo("to@.axosoft.com");

msg.EmailMessageType = MessageType.HTML;

msg.EmailMessage = "any html text";

msg.EmailSubject = "Test Message";

Smtp smtp =new Smtp();

smtp.SmtpServer = "smtpserver.domainname.com";

smtp.SmtpUser = "user_if_required";

smtp.SmtpPassword = "password_if_user_is_required";

smtp.SendEmail(msg);

regards,

satish

0 comments:

Post a Comment