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 !




Send email in HTML format - Smtp mail in .net


Posted Date: 14 Feb 2004    Resource Type: Articles    Category: .NET Framework

Posted By: Tony John       Member Level: Gold
Rating:     Points: 10



This vb.net code snippet shows Sending an HTML mail.

Dim myMail As New MailMessage
myMail.From = MailFrom
myMail.To = MailTo
myMail.Subject = Subject
myMail.BodyFormat = MailFormat.Html

' Just to make sure new lines are line breaks in HTML
Message = Message.Replace(vbCrLf, "<BR>")

myMail.Body = "<html><head><title>" & Subject & "</title></head><body>" & Message & "</body></html>"
SmtpMail.Send(myMail)




Responses

Author: irfan    04 Jan 2005Member Level: Bronze   Points : 0
I have done the same thing (coding) in c#.Net but there is a error with this code

/*
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll
Additional information: Could not access 'CDO.Message' object.
*/

My code was as under:
MailMessage Message = new MailMessage();
Message.To = "iAfzal@lmkr.com";
Message.From = "iAfzal@lmkr.com";
Message.Subject = "nothing";
Message.Body = " Have u received my email .... just checking";
SmtpMail.SmtpServer = "http://www.lmkr.com";
SmtpMail.Send(Message);

Please response me if there is wrong with this code. i will be very thank full to you.


Author: k.selvambikaikathirvel    09 Nov 2005Member Level: Bronze   Points : 0
Hi sir,

I saw your article in dotnet spider.It's vey superb,simple and concise.sir.Now,I want to send mail from asp.net with link to receiver.Then receiver click the link,the acknowledgement will come to sender with some details given by receiver like username and then sender send some other details to receiver like received username and autogenerated password.This is followed in some websites.Like that I also need for my project .It is very Urgent..........Please help me sir.please reply me as soon as possible

Thanks in advance.
Regards
K.Selvambikai
mail to:kselvambikai@gmail.com


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Reading from config files
Previous Resource: Sending text mail using SmtpMail
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use