Use System. Web. Mail to send an email:
Public void Sendmail (){Mailmessage mail1 = new mailmessage ();Mail1.body = "body here"; // body of the emailMail1.from = "xxx@your.com"; // the sender's addressMail1.to = "yyy@their.com"; // recipient's
Here we mainly use Gmail, the reason is because, I use Gmail mailbox to send mail, encountered a small difficulty, and the use of 163 mailbox, did not encounter this problem.
In asp.net2.0, sending mail is very simple, we mainly use several classes
I'll give you an example of a mass mailing with C #
1,. Net Messaging functionality needs to be added. Net.mail reference using System.Net.Mail;
2, can be based on their own needs to design a simple front page:
Define a method for getting
The procedure is this:
Copy Code code as follows:
static void Main (string[] args)
{
SmtpClient client = new SmtpClient ();
Client. Host = "localhost";
MailAddress from = new MailAddress ("from@test.com");
MailAddress
ASP tutorial. Net Send mail code
MailMessage MAILMSG = new MailMessage ();Set the recipient's e-mail addressmailmsg.to = "bailichunwow@qq.com";Set the sender's e-mail addressMailmsg.from = "bailichun@vip.qq.com";Set Message
Some time ago using the System.Net.Mail.MailMessage class to write a mail bulk send the program, in debugging and testing encountered some of the problems and share with you, hope to be helpful to everyone.
There are a number of ways to send
The example of this article describes the implementation of ASP.net sending mail. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
MailMessage MAILMSG = new MailMessage ();
Set
ASP tutorial. NET C # send mail implementation code
MailMessage mailmessage = new MailMessage ();Mailmessage.to.add (This.txtto.text);Mailmessage.from = new System.net.mail.mailaddress (this.txtfrom.text);Mailmessage.subject =
Example:
Copy Code code as follows:
163.com of the mailbox in the early application is supported, the subsequent application is not supported.
21cn.com seems to have given up SMTP support now, and may only be paid by the user.
Qq.
Case Cheng
The message content call picture format is:
The service-side code for sending the message is:
SmtpClient the object//code to send the message is omitted
Copy Code code as follows:
System.Net.Mail.MailMessage
The example of this article for everyone to share the implementation code of the. Net send mail, for everyone's reference, the specific contents are as follows
Key code:
Need to reference namespaces:
Using System.Net.Mail;Using System.Net;
How is JS mixed with JSP and SSI #include?
You can include pure HTML in a JSP in the following ways:
But if the data.inc contains JSP CODE, we can use:
How do I perform a thread-safe JSP?
Just add the following instructions
How does a JSP handle
asp.net
First, IntroductionToday, e-mail has become a ubiquitous, asynchronous notification, and distributed messaging system. There are many web development sites where server-side code needs to generate an e-mail message and send it to the
Send mail
In the. NET Framework 1.x we need to use classes under the System.Web.Mail namespace to send mail, but the function is weak, such as your mail server needs to verify to send mail, in. NET 1.1, you need to use the following code for
Asp.net| issue in the new release of ASP.net 2.0, Microsoft no longer recommends using the System.Web.Mail namespace instead of the new System.Net.Mail namespace. Many new features have been introduced into the new library, but there are some minor
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.