sending mail through asp.net code

Posted by Shoyebaziz123 under ASP.NET on 8/11/2010 | Views : 19132 | Status : [Member] | Replies : 3
Hi Friends,

can any body give me acomplete code to send mail using asp.net, i have tried severa method but i am not succeed.

Thanks




Responses

Posted by: Shankul2784 on: 8/11/2010 [Member] Bronze

Up
0
Down

Hi,

check some following links-


http://www.dotnetcurry.com/ShowArticle.aspx?ID=65

http://www.codeproject.com/KB/aspnet/EmailApplication.aspx

http://www.aspfree.com/c/a/ASP-Code/Send-Email-using-ASPNET-formatted-in-HTML/

http://www.4guysfromrolla.com/articles/072606-1.aspx

I hope, it will help you.



Thanks & Regards,

Shailesh

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 8/11/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Here is the Perfect example that works with Gmail

http://www.dotnetfunda.com/articles/article747-how-to-send-an-email-using-gmail-in-aspnet-.aspx

Thank you for posting at Dotnetfunda
[Administrator]

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vanchi050585 on: 8/12/2010 [Member] Starter

Up
0
Down
hai use it ,

it will work fine.
Dont forgot mark as answer


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
sendingmail(TextBox1.Text);
}
protected void sendingmail(string ToID)
{
MailMessage msg = new MailMessage();
SmtpClient c = new SmtpClient();
msg.From = new MailAddress("fromaddress");
msg.To.Add(new MailAddress(ToID));
msg.Subject = "you have been successfully registered in matrimonial";
msg.Body = "welcome Vanchinathan";
msg.IsBodyHtml = true;
c.Host="mail.domainname.com";
c.Port=25;
c.UseDefaultCredentials=true;
c.Credentials=new System.Net.NetworkCredential("fromaddress", "password");
c.Send(msg);
}

}

Dont forgot mark as answer
Thanks

Thanks
tvn

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response