by Roderick Thompson (12 Submissions)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 1st February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple function to send an email message using CDO
Function SendEMail (MsgFrom, MsgTo, MsgSubject, MsgText)
Dim objCDO As New CDONTS.NewMail
objCDO.To = MsgTo
objCDO.From = MsgFrom
objCDO.Importance = 1
objCDO.Subject = MsgSubject
objCDO.Body = MsgText
objCDO.Send
Set objCDO = Nothing
End Function
For VBScript:
Function SendEMail (MsgFrom, MsgTo, MsgSubject, MsgText)
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = MsgTo
objCDO.From = MsgFrom
objCDO.Importance = 1
objCDO.Subject = MsgSubject
objCDO.Body = MsgText
objCDO.Send
Set objCDO = Nothing
End Function