May 12, 2021 ASP.NET
1. ASP.NET Web Pages - WebMail Helper
3. Prerequisite: Email support
4. First: Edit your AppStart page
7. Second: Create an e-mail input page
WebMail Helper - One of ASP.NET many useful web helpers.
The purpose of the WebMail helper is to make it easy to send messages, please refer to this article for detailed use.
The WebMail Helper makes it easier to send messages by sending messages from a web application under SMTP (Simple Mail Transfer Protocol Simple Message Transfer Protocol).
To demonstrate how to use e-mail, we'll create an input page that lets users submit one page to another and send a message about support issues.
If you've already created a Demo application in this tutorial, you already have a page called _AppStart.cshtml that reads:
To launch the WebMail helper, add the following WebMail property to your AppStart page:
Property explanation:
SmtpServer: The name of the SMTP server used to send e-mail messages.
SmtpPort: The port used by the server to send SMTP transactions (e-mail messages).
EnableSsl: If the server is encrypted using SSL (Secure Socket Layer Security Layer), the value is true.
UserName: The name of the SMTP email account used to send e-mail messages.
Password: The password for the SMTP email account.
From: The e-mail message displayed in the sending address bar (usually the same as UserName).
Next, create an input page and name it Email_Input:
The purpose of entering a page is to send the phone information, and then submit the data to a new page that can send the information as an e-mail message.
Next, create a page to send e-mail and name it Email_Send:
To learn more about ASP.NET the Web Pages application, check out the WebMail Object Reference Manual.