| Author: Arun Jacob 29 Nov 2008 | Member Level: Gold | Rating:  Points: 4 |
You can send mail using System.Web.Mail Namespace.
MailMessage message= new MailMessage(); message.From = "fromemailid; message.To = "toemailid"; message.Subject = "Subject of the Mail"; message.Body = "Body Of the Mail"; SmtpMail.SmtpServer = "yourservername"; SmtpMail.Send(message);
:-)
Arun Jacob http://codepronet.blogspot.com/
|
| Author: ChandraShekar Thota 29 Nov 2008 | Member Level: Diamond | Rating:  Points: 1 |
Hi
You can use gmail smtp for testing. It is smtp.googlemail.com
Cheers Chandu
chandrashekarthota@gmail.com /92 93 95 95 39 FREE SESSIONS ON .NET AND VISUALSTUDIO
|
| Author: srujana 30 Nov 2008 | Member Level: Bronze | Rating:  Points: 6 |
MailAddress ad = new MailAddress(TextBox1.Text, "srujana"); mail.From = ad; MailAddress ad1 = new MailAddress(TextBox2.Text); MailAddressCollection adc = new MailAddressCollection(); adc.Add(ad1); mail.To.Add(ad1); mail.Subject = TextBox3.Text; mail.Body = TextBox4.Text; mail.Priority = MailPriority.Normal; //for gmail SmtpClient objMail = new SmtpClient("smtp.gmail.com", 587); //for hotmail //SmtpClient hotmail = new SmtpClient("smtp.live.com", 24); NetworkCredential info = new NetworkCredential("abc@gmail.com", "xyz"); objMail.DeliveryMethod = SmtpDeliveryMethod.Network; objMail.Credentials = info; objMail.EnableSsl = true; try { objMail.Send(mail); } } catch (Exception ex) { Response.Write(ex.Message); }
|
| Author: Deepika Haridas 30 Nov 2008 | Member Level: Diamond | Rating:  Points: 6 |
MailAddress ad = new MailAddress(txtadd.Text, "abc"); mail.From = ad; MailAddress ad1 = new MailAddress(txtadd1.Text); MailAddressCollection adc = new MailAddressCollection(); adc.Add(ad1); mail.To.Add(ad1); mail.Subject = txtsub.Text; mail.Body = txtbody.Text;
mail.Priority = MailPriority.Normal; SmtpClient objMail = new SmtpClient("smtp.gmail.com", 587); NetworkCredential info = new NetworkCredential("xxx@gmail.com", "xyz"); objMail.DeliveryMethod = SmtpDeliveryMethod.Network; objMail.EnableSsl = true; try { objMail.Send(mail); } } catch (Exception ex) { Response.Write(ex.Message); }
Regards, Deepika
Thanks & Regards, Deepika Editor
If U want to shine like a SUN..First U have to burn like the SUN!! Need a Guide? Join my mentor program..
|
| Author: puneet malviya 30 Nov 2008 | Member Level: Gold | Rating:  Points: 6 |
Hi ..
<% @Page Language="C#" %> <% @Import Namespace="System.Web.Mail" %> <% MailMessage msgMail = new MailMessage();
msgMail.To = "christophw@sleeper.Dev.AlfaSierraPapa.Com"; msgMail.Cc = "webmaster@sleeper.Dev.AlfaSierraPapa.Com"; msgMail.From = "webmaster@aspheute.com"; msgMail.Subject = "Hi Chris, another mail";
msgMail.BodyFormat = MailFormat.Html; string strBody = "<html><body><b>Hello World</b>" + " <font color=\"red\">ASP.NET</font></body></html>"; msgMail.Body = strBody;
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk"); %>
And check this link this link is helpful for u
http://www.aspheute.com/english/20000918.asp
check it
|
| Author: puneet malviya 30 Nov 2008 | Member Level: Gold | Rating:  Points: 6 |
Hi ..
<% @Page Language="C#" %> <% @Import Namespace="System.Web.Mail" %> <% MailMessage msgMail = new MailMessage();
msgMail.To = "christophw@sleeper.Dev.AlfaSierraPapa.Com"; msgMail.Cc = "webmaster@sleeper.Dev.AlfaSierraPapa.Com"; msgMail.From = "webmaster@aspheute.com"; msgMail.Subject = "Hi Chris, another mail";
msgMail.BodyFormat = MailFormat.Html; string strBody = "<html><body><b>Hello World</b>" + " <font color=\"red\">ASP.NET</font></body></html>"; msgMail.Body = strBody;
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk"); %>
And check this link this link is helpful for u
http://www.aspheute.com/english/20000918.asp
check it
|
| Author: Asal-2009 30 Nov 2008 | Member Level: Diamond | Rating:  Points: 6 |
hi, u first import the namespace for mail
Imports System.Web.Mail
then put the below code and call it whereever ur want.
Sub sendmail(ByVal password)
Dim objEmail As New MailMessage objEmail.To = txtEmail.Text objEmail.From = "nathan.rengan@gmail.com" objEmail.Subject = "Regarding Password" objEmail.Body = "this is your new password " + password Try SmtpMail.Send(objEmail) txtUserName.Text = "" txtEmail.Text = "" Response.Write("Your E-mail has been sent sucessfully")
Catch exc As Exception Response.Write("Send failure: " + exc.ToString()) End Try End Sub
i hope this may help u
G.Rajan Happy New Year
|