Hi, everyone! I'm trying to send mail in ASP.NET web-site. I have smtp configuration section in web.config file. How can I configure it to send mail from everyone to everyone?
A:
Is this what you're looking for?
SmtpMail.Send("From","To","Subject","Message");
Just specify the From and To email addresses and you're set.
SmtpMail can be found in System.Web.Mail.
Martin S.
2010-10-14 11:54:24
A:
You don't need to have anything in web.config as que SMTP server can be specified in the SmtpClient constructor. Then, if you need authentication, you can specify a NetworkCredential and the message in a MailMessage object. Example:
var client = new SmtpClient(smtpHost);
client.Credentials = new NetworkCredential(username, password);
var message = new MailMessage(from, to, subject, body);
client.Send(m);
Marc Climent
2010-10-14 11:56:19
A:
Hi,
Your question is a bit vauge.
If you want to send it from "everyone", then you will always need to specify a different FROM parameter for every message. You do not want to set the FROM value in the .config file.
If you are looking for code examples, I encourge you to check out my site at www.SystemNetMail.com
hth,
Dave
dave wanta
2010-10-14 12:08:29