WP TutorialLesson 14Free preview
WebPages Email
This lesson is part of ASP · All levels
Summary
Web Pages provides WebMail helpers to send email from the server side via SMTP servers. You need to configure SMTPs like hosts, ports, and credentials on App_Start, and then just call WebMail.Send. This feature is useful for notifications, password resets, and contact forms, with the SMTP security configuration note to be correct.
Key points
- SMTP configuration is done via WebMail.SmtpConfig with hosts, ports, and credentials.
- WebMail.Send(receiving, subject, content) sending a message to one address.
- Additional cc and attachment files are available in the Send parameter.
- Secure the SMTP credentials in web.config, do not write hard-coded on the page.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.