srk1982
asked on
Formatting the body while sending email using asp.net 1.1
Hi,
I use the below code to send email using asp.net 1.1 and codebehind as c#.
here what i want is....In the email which is sent, the body shud be with a line break. like this :
__________________________ __________ ______
Hi
Risk strRiskNo,
Insured strInsuredName
is sent for your review
Thanks
__________________________ __________ ______
currently i get the body like this...
Hi<br>Risk PQ2008000463,Insured HAVEis sent for your review<br>Thanks
There is no line break for the code which i have pasted below.
Please help on this..
Its urgent
Thanks..
I use the below code to send email using asp.net 1.1 and codebehind as c#.
here what i want is....In the email which is sent, the body shud be with a line break. like this :
__________________________
Hi
Risk strRiskNo,
Insured strInsuredName
is sent for your review
Thanks
__________________________
currently i get the body like this...
Hi<br>Risk PQ2008000463,Insured HAVEis sent for your review<br>Thanks
There is no line break for the code which i have pasted below.
Please help on this..
Its urgent
Thanks..
MailMessage objEmail = new MailMessage();
objEmail.To = strEmailID;
objEmail.From = "admin.abc@sg.abc.com";
objEmail.Subject = "Quotation for Review";
objEmail.BodyFormat = MailFormat.Html;
objEmail.Body = "Hi" + "<BR>" + "Risk " + strRiskNo + ",Insured " + strInsuredName + "is sent for your review" + "<br>" + "Thanks" ;
objEmail.Priority = MailPriority.High;
SmtpMail.SmtpServer = strSmtpServer;
try
{
SmtpMail.Send(objEmail);
lblmsg.Text = "Quotation has been sent for review" ;
}
catch (Exception exc)
{
throw exc;
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually I don't see any problem with your code (see http://www.systemwebmail.c om/faq/2.2 .aspx). Are you sure that your email-receiver can handle html-messages (or turned in) and not only text ?
ASKER
Hi Dhaest,
I tried with the same sample provided in the link, that u posted in the previous post.
I am not getting the line break.
There is shud be something missing or going wrong...
Please help...Thanks
I tried with the same sample provided in the link, that u posted in the previous post.
I am not getting the line break.
There is shud be something missing or going wrong...
Please help...Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hey this is a fantastic answer. It really helped me a lot.
To add on to this look at this link.
http://stackoverflow.com/questions/1660932/how-do-i-send-formatted-text-in-email-using-c
To add on to this look at this link.
http://stackoverflow.com/questions/1660932/how-do-i-send-formatted-text-in-email-using-c
ASKER
I could not find any property like HTMLBody for the object objEmail.
Thanks,