
Sending an Email with Classic ASP using ASPEmail
The following code sample demonstrates a simple email-sending form using ASPEmail component offered on Windows Hosting accounts.<% ' change to address of your domain strHost = "yourdomain.com" If Request("Send") <> "" Then Set Mail = Server.CreateObject("Persits.MailSender") ' enter valid SMTP host Mail.Host = strHost Mail.From = Request("From") ' From address Mail.FromName = Request("FromName") ' optional Mail.AddAddress Request("To") ' message subject Mail.Subject = Request("Subject") ' message body Mail.Body = Request("Body") strErr = "" bSuccess = False On Error Resume Next ' catch errors Mail.Send ' send message If Err <> 0 Then ' error occurred strErr = Err.Description else bSuccess = True End If End If %> <html> <body bgcolor="#FFFFFF"> <% If strErr <> "" Then %> <h3>Error occurred: <% = strErr %> <% End If %> <% If bSuccess Then %> Success! Message sent to <% = Request("To") %>. <% End If %> <form method="POST" action="Simple.asp"> <table cellspacing=0 cellpadding=2 BGCOLOR="#E0E0E0"> <tr> <td>Host (change as necessary in script):</td> <td><b><% = strHost %></b></td> </tr> <tr> <td>From (enter sender's address):</td> <td><INPUT TYPE="TEXT" NAME="From"></td> </tr> <tr> <td>FromName (optional, enter sender's name):</td> <td><INPUT TYPE="TEXT" NAME="FromName"></td> </tr> <tr> <td>To: (enter one recipient's address):</td> <td><INPUT TYPE="TEXT" NAME="To"></td> </tr> <tr> <td>Subject:</td> <td><INPUT TYPE="TEXT" NAME="Subject"></td> </tr> <tr> <td>Body:</td> <td><TextArea name=“Body"></TEXTAREA></td> </tr> <tr> <td colspan=2><input type="SUBMIT" NAME="Send" value="Send Message"> </td> </tr> </table> </form> </body> </html>
How To Set Mail Priority in ASPEmail ?
There are a few of headers that may be changed to line message priority. The Priority property sets the message priority on a scale of one to five. A priority of one means that HIGH. A priority of three means that normal and a priority of five means that LOW. additionally to the present you'll also set the imperative property if the message status is imperative. The imperative property may be a true/false property.
How to Use the DateTime Property in ASPEmail
The part creates a Date/Time value for the message supported the calculated Greenwich Time time. The DateTime property was additional to permit users to line a custom date/time timezone. the subsequent code demonstrates a way to set the DateTime to North American nation Central local time. By slightly altering the values underlined you'll adjust this to figure for your timezone.
[set other Mailer properties] Mailer.DateTime = WeekDayName(WeekDay(Date), true) & ", " & Day(Date) & " " & MonthName(Month(Date), true) & _ " " & Year(Date) & " " & FormatDateTime(Now, 4) & ":00 -0600 (CST)" Mailer.SendMail
Best and Cheap Windows ASP Hosting With ASPEmail in Classic ASP Hosting Recommendation
HostForLIFE.eu has great experience in providing the best Classic ASP Hosting support for their many happy customers. Whatever your budget, Classic AP Hosting with HostForLIFE.eu means affordable and
reliable Windows hosting. You will enjoy the full support of the experienced
HostForLIFE.eu team, 24 hours a day, 7 days a week. Affordable Budget
prices, full features, 99.9% Uptime Guarantee, No Risk with 30 day
Money-Back Guarantee for the best NopCommerce Hosting services!
HostForLIFE revolutionized hosting with Plesk 12 panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Some other hosting providers manually execute configuration requests, which can take days. Plesk 12 completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk 12 Panel is available only to HostForLIFE's customers.
HostForLIFE revolutionized hosting with Plesk 12 panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Some other hosting providers manually execute configuration requests, which can take days. Plesk 12 completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk 12 Panel is available only to HostForLIFE's customers.
0 comments:
Post a Comment