hi friends
i want code for sending email.
pls send youtube like
for career i create form after i click submit it will goto our own email please send code for that.
Submit Resume | |
Name | ControlToValidate="TextBox1" ErrorMessage="Please Enter Full Name" ForeColor="Red"> |
Email | ControlToValidate="TextBox2" ErrorMessage="Enter Correct Mail id" ForeColor="Red" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"> |
Phone No | ControlToValidate="TextBox3" ErrorMessage="Enter Valid Mobile No" ForeColor="Red"> |
Subject | ControlToValidate="TextBox4" ErrorMessage="Please Enter Subject " ForeColor="Red"> |
Message | ControlToValidate="TextBox5" ErrorMessage="Enter Detail Information" ForeColor="Red"> |
Width="101px" /> Width="101px" /> | |

karthi geyanPosted Mar 25, 2014, 2:35 AM
Sunny SharmaPosted Mar 25, 2014, 1:54 AM
Plenty of articles on the same topic are out there on the forum, just explore them:
http://www.c-sharpcorner.com/UploadFile/9f0ae2/send-emails-with-attachment-in-Asp-Net/
Explore them here;
http://www.c-sharpcorner.com/tags/1/send-email
Cheers!!
Abhay ShankerPosted Mar 25, 2014, 1:52 AM
protected string SendEmail(string toAddress, string subject, string body)
{
string result = "Message Sent Successfully..!!";
string senderID = "SenderEmailID";// use sender's email id here..
const string senderPassword = "Password"; // sender password here...
try
{
SmtpClient smtp = new SmtpClient
{
Host = "smtp.gmail.com", // smtp server address here...
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
Credentials = new System.Net.NetworkCredential(senderID, senderPassword),
Timeout = 30000,
};
MailMessage message = new MailMessage(senderID, toAddress, subject, body);
smtp.Send(message);
}
catch (Exception ex)
{
result = "Error sending email.!!!";
}
return result;
}