| SENDING EMAIL FROM YOUR ASP PAGES |
|
|
To send email from your ASP pages, use the following code.
|
|
|
<% Const cdoBasic = 1 'Use basic (clear-text) authentication. Const cdoSendUsingPort = 2 'cdosys related Dim iMsg Dim iConf Dim Flds 'mail related Dim strMsg Dim strTo Dim strCC Dim strFrom Dim strSubject Dim strTextBody '==================begin your configuration============================= 'you must have a username and pass word or you will not be able to send ' Dim sendusername : sendusername = "user@userdomain.com" Dim userpassword : userpassword = "yourpassword" Dim smtpserver : smtpserver = "yoursmtpserver" 'end your configuration '===================begin set your info here============================ 'set your TO, CC, From, Subject and body here ' strTo = "touser@somedomain.com" strCC = "anotheruser@somedomain.com" strFrom = "fromuser@somedomain.com" strSubject = "Insert here your subject text" strTextBody = "Insert here your plain body text" 'end set your info here 'Create message and configuration objects set iMsg = CreateObject("CDO.Message") set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields 'Apply settings to the configuration object With Flds End With 'Apply the settings to the message object and send it With iMsg End With ' cleanup mail objects Set iMsg = Nothing Set iConf = Nothing Set Flds = Nothing %> |
|