Click to See Complete Forum and Search --> : Explain ASP script please


acemo
11-01-2005, 09:51 AM
Could someone explain what this script does?
when looking at the <- thingy's i understand this script enough?

[code]
<%
function mailer(message, mailTo)
Dim mail
set mail = Server.CreateObject("Persits.MailSender")
mail.host = smtp <- i put here my smtp host
mail.port = port <- i put here the port of my smtp host
mail.from = "Fromme@domian.com" <- i put here the address to be the sender address
mail.fromname = "From Me" <- i put here the name to be the sender name
mail.AddAddress MailTo 'passed to this function
mail.addbcc "bbcme@domain.com" <- i put here the bcc address
mail.subject = "email subject" <- i put here the subject of the email
mail.body = message ' email message <- i put here an variable with the body of the mail
mail.IsHTML = True
On Error Resume Next
Mail.Send
end function
%>
[code]

buntine
11-01-2005, 07:39 PM
The function simply creates an instance of the ASPEmail object (Persits.com) and uses it in an attempt to send an email message.

The AddAddress function is used to add a recipient address for the email message. Several recipients can be added. The IsHTML property is used to tell the server that the message is to be sent HTML encoded.

On Error Resume Next is in-built VBScript error handling functionality. If this command is issued, the script will continue running if an error is thrown rather, than terminate processing.

As implied, the Send function actually attempts to send the email message.

Regards.