SPUtility.SendEmail
In my project I need to send mail to Administrator, while adding items to a list using Webpart. I have tried ASP.Net, System.Net namespace but I need to read all the server and mail settings from any config file. After I got sharepoint’s own mechanism to send mail.
SPUtility.SendEmail(SPContext.Current.Site.OpenWeb(), false, false, "admin@myserver.com", "Hello World", "This is a Sample Mail");
This will send a mail to “admin@myserver.com”, with “Hello World” as subject and “This is a Sample Mail” as body. You can send HTML emails by changing the third parameter to TRUE.
Update : You may need to use SPSecurity.RunWithElevatedPrivileges method to send mails.
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
This method enable users to Execute the specified method with Full Control rights even if the user does not otherwise have Full Control.

hi i have used this code but html tags is not working . please help
Hi Jain,
Where you are using HTML tags? in message body? And how you come to know it is not working? I got the same issue, but it was the problem of the Outlook, try changing the mail display format.
Anuraj
Hi anuraj!
My problem is that the SPUtility.SendEmail returns false and I don’t know how I can check why it is not sending anything. I have also tried to send mail using System.NET.Mail, and it also fails.
Any suggestions ?
Morten
How to I change or set the display name of an e-mail send with the SPUtility.sendEmail ?
I am looking for the receiver to get a mail with Frederik [f@k2c.dk] in the FROM field…
Any suggestions?
/ Frederik
Sorry Frederik. I don’t think we can do it. [:(]
I have almost the same problem SpUtility.SendEmail
return True but the email is not sent and i could not find any thing in the Applog note I am using SpUtility.SendEmail from SPTimerJob
Hoi , I think you might be able to do it. Please check http://www.myfatblog.co.uk/?p=79, I have tried it in my project and it works.
You should check SharePoint logs at information level to find out if there are messages that may lead you to source of your problem.
Thanks Gunnar, thanks for the valuable information.