Fri Apr 08, 2011 8:41 pm
<html>
<%
End Sub
Function sendMail(ByVal mailTo, ByVal mailFrom, ByVal mailSubject, ByVal mailBody)
Dim objMailSender = Server.CreateObject("CDONTS.NewMail")
objMailSender.To = mailTo
objMailSender.From = mailFrom
objMailSender.Subject = mailSubject
objMailSender.Body = mailBody
objMailSender.Send()
objMailSender = Nothing
If Err Then
SendMail = False
Else
SendMail = True
End If
End Function
%>
<p>Calling the send mail function</p>
<%
sendMail "[email protected]" , "[email protected]" , "Mail Subject" , "Mail Body"
%>
</html>
<%
Dim objMailSender
'create an instance of CDONTS
objMailSender = Server.CreateObject("CDONTS.NewMail")
'From Email
objMailSender.From = "[email protected]"
'TO Email.
objMailSender.To = "[email protected]"
'Email Subject
objMailSender.Subject = "subject:contains attach"
'File path to be attached
objMailSender.AttachFile("c:\img.gif")
'Email body
objMailSender.Body = "Email body."
Send the Email
objMailSender.Send()
objMailSender = Nothing
%>
<%
'create objects.
Dim objEmailSender, strHTMLContent
objEmailSender = Server.CreateObject("CDONTS.NewMail")
'Add some html
strHTMLContent = strHTMLContent & "<html><head><title>Title</title></head>"
strHTMLContent = strHTMLContent & "<body>"
strHTMLContent = strHTMLContent & "<p>Paragraph part</p>"
strHTMLContent = strHTMLContent & "<br><hr>"
strHTMLContent = strHTMLContent & "<b>Bold string</b>"
strHTMLContent = strHTMLContent & "<a href=""#"">link</a>"
strHTMLContent = strHTMLContent & "</body></html>"
'From Email
objEmailSender.From = "[email protected]"
'To Email
objEmailSender.To = "[email protected]"
'Subject
objEmailSender.Subject = "HTML email"
' The body is HTML content
objEmailSender.Body = strHTMLContent
'Used to format html emails.
objEmailSender.BodyFormat = 0
objEmailSender.MailFormat = 0
'Send the Email.
objEmailSender.Send()
objEmailSender = Nothing
%>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.