<html> <head> <title>ThaiCreate.Com PHP Sending Email</title> </head> <body> <? $strTo = "[email protected]"; $strSubject = "Test sending mail"; $strHeader = "From: [email protected]"; $strMessage = "My Body & My Description"; $flgSend = mail($strTo,$strSubject,$strMessage,$strHeader); if($flgSend) { echo "Email sending."; } else { echo "Email cannot send."; } ?> </body> </html>
<%@ Import Namespace="System.Web.Mail"%> <%@ Page Language="VB" %> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) Dim myMail As New MailMessage() myMail.To = "[email protected]" myMail.From = "[email protected]" myMail.Subject = "Test sending mail" myMail.BodyFormat = MailFormat.Text myMail.Body = "My Body & Description" SmtpMail.Send(myMail) myMail = Nothing Me.lblText.Text = "Mail Sending." End Sub </script> <html> <head> <title>ThaiCreate.Com ASP.NET - Send Mail</title> </head> <body> <form id="form1" runat="server"> <asp:Label id="lblText" runat="server"></asp:Label> </form> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท