borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Sentence for call another page from asp pages)Next Topic (question about validation control) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : how to mail html page
Poster Message
tri_inn
Level: Regular User
Registered: 26-08-2002
Posts: 395

icon how to mail html page

i want to develop a web form from where user can send html mail means a jazzy web page not as attachment rather mail body.
please tell me how could i develop that kind of web application by asp.net.

14-06-2004 at 12:47 PM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: how to mail html page

You have to specify the mail format in  your mail body
check out this simple method  that sends mail

public void SendMail()
{
MailMessage mail = new MailMessage();
mail.To = Email.Text.Trim();
mail.Cc = ConfigurationSettings.AppSettings["CarbonCopy"];
mail.From =ConfigurationSettings.AppSettings["Sender"];
mail.Subject = " Thank you for registering";
mail.BodyFormat = MailFormat.Html;
mail.Body = " Thank you "+Name.Text+" for registering please take note of the following details \n"+
"Username = "+Email.Text+"\n"+" Password = "+Password.Text;
MyError.ForeColor = Color.Green;
try
{
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["MailServer"];
SmtpMail.Send(mail);
MyError.Text ="Thank you for registering. A confimation email has been sent to you!";
pnlRegister.Visible = false;
LinkButton1.Visible = true;


}
catch (Exception ex)
{
MyError.Text="Sorry your message was not sent because an Error occured: Please verify that your email address is correct";

}
}


construct the message as  a normal html page

____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

21-06-2004 at 08:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ASP.Net : how to mail html page
Previous Topic (Sentence for call another page from asp pages)Next Topic (question about validation control) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder