How can send the Email in the Asp.net?
try
{
string strPassword = string.Empty;
string strMailFrom = string.Empty;
string smtpServer = "ServerName";
SmtpClient smtp = new SmtpClient();
strMailFrom = "Email Id";
strPassword = "Password";
smtp.Host = smtpServer;
smtp.Port = 25;
//smtp.EnableSsl = true;
//check the Authentication
If(true)
{
smtp.UseDefaultCredentials = true;
smtp.Credentials = new System.Net.NetworkCredential(strMailFrom, strPassword);
}
MailMessage mail = new MailMessage();
mail.From = new MailAddress(strMailFrom);
mail.To.Add("EmailId");
mail.Bcc.Add("EmailId");
mail.Subject = m_strEmailSubject.ToString();
mail.Body = m_strEmailMessage.ToString();
smtp.Send(mail);
}
catch (Exception objException)
{
throw new Exception(objException.Message.ToString());
}
tag-:How can send the Email in the Asp.net?
Smtp,Email,SmtpClient
Articles
- Articles(C#.NET) (3)
- ASP.NET (6)
- Asp.Net(Email) (1)
- Asp.net(Image) (2)
- Asp.Net(Web.Config) (2)
- C#.NET (5)
- C#.NET Threading (3)
- C#.NET(ASP.NET) (4)
- Comments in PHP (1)
- Encryption In PHP (1)
- iPhone (Articles) (1)
- JavaScript (1)
- Json with PHP (1)
- LINQ (1)
- PHP (2)
- PHP Constant (1)
- PHP Operators (1)
- PHP Print Command (1)
- PHP Tutorial (2)
- Strings In PHP (1)
- Variable Declaration In PHP (1)
- WPF (1)
- XAML (2)
About Me
Help Link
Followers
Posted by
Sreejith A.K
Wednesday, September 29, 2010
Labels:
Asp.Net(Email)
Subscribe to:
Post Comments (Atom)