<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <% Dim myMail,HTML,strMsg Set myMail = Server.CreateObject("CDO.Message") Dim cdoConfig Set cdoConfig = myMail.Configuration With cdoConfig.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 '*** Authentication ***' .Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myuser" '*** User ***' .Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword" '*** Password ***' .Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30 .Update End With myMail.Configuration = cdoConfig strMsg = "" strMsg = strMsg &"<h1>My Message</h1><br>" strMsg = strMsg &"<table width='285' border='1'>" strMsg = strMsg &" <tr>" strMsg = strMsg &" <td><div align='center'><strong>My Message </strong></div></td>" strMsg = strMsg &" <td><div align='center'><font color='red'>My Message</font></div></td>" strMsg = strMsg &" <td><div align='center'><font size='2'>My Message</font></div></td>" strMsg = strMsg &" </tr>" strMsg = strMsg &" <tr>" strMsg = strMsg &" <td><div align='center'>My Message</div></td>" strMsg = strMsg &" <td><div align='center'>My Message</div></td>" strMsg = strMsg &" <td><div align='center'>My Message</div></td>" strMsg = strMsg &" </tr>" strMsg = strMsg &" <tr>" strMsg = strMsg &" <td><div align='center'>My Message</div></td>" strMsg = strMsg &" <td><div align='center'>My Message</div></td>" strMsg = strMsg &" <td><div align='center'>My Message</div></td>" strMsg = strMsg &" </tr>" strMsg = strMsg &"</table>" myMail.From = "[email protected]" myMail.To = "[email protected]" myMail.Subject = "My Subject" myMail.HTMLBody = strMsg myMail.Send Response.write ("Mail Sending.") Set myMail = Nothing %> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท