Hi,
I am new in development. I want to develop a application which send
email from yahoo acoount to rediffmail acount I am trying following
Code But its giving Server 530 Authetication error.Could you suggest
me anything in this matter.
Thank you,
Sunny
try
{
MailMessage oMsg = new MailMessage();
// TODO: Replace with sender e-mail address.
oMsg.From = "jb****@yahoo.co.in";
// TODO: Replace with recipient e-mail address.
oMsg.To = "ja************@rediffmail.com";
oMsg.Subject = "Send Using Web Mail";
// SEND IN HTML FORMAT (comment this line to send plain text).
oMsg.BodyFormat = MailFormat.Text;
// HTML Body (remove HTML tags for plain text).
oMsg.Body = "Hello World!";
// ADD AN ATTACHMENT.
// TODO: Replace with path to attachment.
String sFile = @"C:\Hello.txt";
MailAttachment oAttch = new MailAttachment(sFile,
MailEncoding.Base64);
oMsg.Attachments.Add(oAttch);
// TODO: Replace with the name of your remote SMTP server.
SmtpMail.SmtpServer = "mail.rediffmail.com";
SmtpMail.Send(oMsg);
oMsg = null;
//oAttch = null;
}
catch (Exception e)
{
Console.WriteLine("{0} Exception caught.", e);
}