Send a complete manual by email

Source: Internet
Author: User
Tags manual mail mailmessage
1. Send a Simple mail with asp+
<% @Page language= "C #"%>
<% @Import namespace= "System.Web.Util"%>
<%
String strto = "Asp888@asp888.net";
String strfrom = "Webmaster@asp888.net";
String strsubject = "asp Send mail simple example";

Smtpmail.send (Strfrom, Strto, Strsubject, "This is just a simple text mail");
Response.Write ("Email has been sent successfully");
%>
2.asp+ Send HTML-formatted mail
Please note that there is another kind of send command here.
<% @Page language= "C #"%>
<% @Import namespace= "System.Web.Util"%>
<%
MailMessage msgmail = new MailMessage ();
msgmail.to = "Asp888@asp888.net";
msgmail.cc = "Doufu@asp888.net";
Msgmail.from = "Webmaster@asp888.net";
Msgmail.subject = "asp+ send HTML formatted mail";
Msgmail.bodyformat = mailformat.html;
String strbody = ""<font color=" Red ">ASP+</font></body>Msgmail.body = strbody;
Smtpmail.send (Msgmail);
Response.Write ("Email has been sent successfully");
%>
3.asp+ send an email with an attachment
<% @Page language= "C #"%>
<% @Import namespace= "System.Web.Util"%>
<%
MailMessage msgmail = new MailMessage ();
msgmail.to = "Asp888@asp888.net";
Msgmail.from = "Webmaster@asp888.net";
Msgmail.subject = "Attachment Test";
Msgmail.bodyformat = Mailformat.text;
Msgmail.body = "Check out the attachment!";
MSGMAIL.ATTACHMENTS.ADD (New MailAttachment ("C:\temp\doufu.txt"));
Smtpmail.send (Msgmail);
Response.Write ("Email has been sent successfully");
%>

OK, after reading this article, do you have no problem with email sending in asp+? Oh! And also
Question, no matter, keep an eye on the update of this site!


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.