Hi,
I am a newby in c#. I want to send an email using smtp. I got the error "type or namespace name smtp could not be found". I wanted then to add the line: using System.Web.Mail but thisnamespace is not recognized (the part with .Mail is not known). Should I add some reference or what should I do in order for my tool to be able to send an email?
Thank you very much!
Serban
Loading
uz_jaswalPosted Jul 21, 2006, 8:57 AM
mallikarjun prasadPosted Jul 13, 2006, 8:23 AM
This is a sample example. U need admin rights to send the mail.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Mail" %>
public void Page_Load(Object sender, EventArgs e)
{
string from = "bob@somewhere.com";
string to = "alice@somewhere.com";
string subject = "Our Message";
string body = "<html><body>OurMessage - success</body></html>";
SmtpMail.Send(from, to, subject, body);
}
Email Sent!
<%@ Page Language="C#" %>