Advertisement
Advertisement
| 07.06.2008 at 01:16AM PDT, ID: 23541409 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: |
C# file:
protected void btnSubmit_Click(object sender, EventArgs e)
{
string from = txtEmail.Text;
string body = txtComments.Text;
MailMessage msg = new MailMessage(from, "ubaidx@gmail.com", "Customer Feedback", body);
SmtpClient mailClient = new SmtpClient("smtp.gmail.com", 25);
mailClient.EnableSsl = true;
mailClient.Send(msg);
msg.Dispose();
Response.Write("Message has been sent");
}
Web.config file:
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="smtp.gmail.com" port="25" userName="ubaidx" password=""/>
</smtp>
</mailSettings>
</system.net>
</configuration>
|