C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Email sending using ASP


Posted Date: 23 May 2008      Total Responses: 2

Posted By: Sama Linga Reddy       Member Level: Silver     Points: 1


how can we send Email using with ASP with sample application?,is there any settings to do.suggest me.



Responses

Author: Ashok Kandasamy    23 May 2008Member Level: DiamondRating:     Points: 2
hi,

In Asp:
Refer this URL
http://www.w3schools.com/asp/asp_send_email.asp

http://www.sitepoint.com/article/sending-email-asp





Author: SSN    23 May 2008Member Level: GoldRating:     Points: 2
send mail using u r gmail account:

public bool SendEmail(
string pGmailEmail,\\you r gmail id
string pGmailPassword,\\your gmail password
string pTo, \\tomail id
string pSubject, \\subject
string pBody, \\body text
System.Web.Mail.MailFormat pFormat,
string pAttachmentPath)
{
try
{
System.Web.Mail.MailMessage myMail = new System.Web.Mail.MailMessage();
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.gmail.com");

myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");

myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", "2");


// authenticate with the service.
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");

//Use 0 for anonymous
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", pGmailEmail);

myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pGmailPassword);

myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");

myMail.From = pGmailEmail;
myMail.To = pTo;
myMail.Subject = pSubject;
myMail.BodyFormat = pFormat;
myMail.Body = pBody;
if (pAttachmentPath.Trim() != "")
{
MailAttachment MyAttachment =
new MailAttachment(pAttachmentPath);
myMail.Attachments.Add(MyAttachment);
myMail.Priority = System.Web.Mail.MailPriority.High;
}

System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com:465";
System.Web.Mail.SmtpMail.Send(myMail);
return true;
}
catch (Exception ex)
{
Console.Write(ex.Message);
throw;
}
}




Post Reply
You must Sign In to post a response.
Next : Regular Expression for file Path(Very Urgent)
Previous : Require monday date if we select any date in a week
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use