Mail sent group function, classic collection.

xiaoxiao2021-03-06  70

Function Sendmail (Comp, Mailserv, Fromname, Fromemail, Toname, Toemail, Subject, Body)

DIM Mymailon Error ResMe Next

SELECT CASE COMP

Case 1 'aspmailset mymail = server.createObject ("smtpsvg.mailer")

myMail.FromName = fromnamemyMail.FromAddress = fromemailmyMail.ContentType = strcontentmyMail.Priority = strprioritymyMail.ReturnReceipt = strreceiptmyMail.RemoteHost = mailservmyMail.AddRecipient toname, toemailmyMail.Subject = subjectmyMail.BodyText = bodymyMail.SendMail

Case 2 'ASPEmailSet myMail = CreateObject ( "Persits.MailSender") myMail.From = fromemailmyMail.FromName = fromnamemyMail.IsHTML = strcontentmyMail.Priority = strprioritymyMail.Host = mailservmyMail.AddAddress toemailmyMail.Subject = subjectmyMail.Body = bodymyMail.Send

Case 3 'CDONTSSet myMail = server.CreateObject ( "CDONTS.NewMail") myMail.To = toemailmyMail.Value ( "Reply-To") = fromemailmyMail.From = fromemailmyMail.Subject = subjectmyMail.MailFormat = strcontentmyMail.BodyFormat = strcontentmyMail.Importance = strprioritymymail.body = bodymymail.send

Case 4 'DYNU Emailset mymail = server.createObject ("DYNU.EMAIL") MyMail.ishtml = truemailmail.smtp = mailservresult = mymail.send (Fromemail, Toemail, Subject, Body)

Case 5 'W3 JMail 4.1set myMail = Server.CreateOBject ( "JMail.Message") myMail.Logging = truemyMail.silent = truemyMail.From = fromemailmyMail.FromName = fromnamemyMail.AddRecipient toemail, tonamemyMail.Subject = subjectmyMail.Body = bodySendMail = mymail.send (MailServ)

Case 6 'W3 JMail 4.1 HTMLSet myMail = Server.CreateObject ( "JMail.Message") myMail.AddRecipient toemail, tonamemyMail.From = fromemailmyMail.Body = "Sorry, you can not read HTML." MyMail.Subject = subjectmyMail.HTMLBody = bodySendMail = myMail.Send (mailserv) Case 7 'Simple MailSet myMail = Server.CreateObject ( "ADISCON.SimpleMail.1") myMail.MailServer = mailservmyMail.Sender = fromemailmyMail.Recipient = toemailmyMail.Subject = subjectmyMail.MessageText = bodycall myMail.Send

Case 8 'ocxmailset mymail = server.createObject ("aspmail.aspmailctrl.1) Result = mymail.sendmail (MailServ, Toemail, Fromemail, Subject, Body)

Case 9 'VSMail 1.xSet myMail = CreateObject ( "VSEmail.SMTPSendMail") myMail.Host = mailservmyMail.From = fromname & "<" & fromemail & ">" myMail.SendTo = toemailmyMail.Subject = subjectmyMail.Body = bodymyMail. ConnectMymail.send

End SELECT

Set mymail = Nothing

If Err Tensendmail = FalseelSendmail = TrueEnd IF

END FUNCTION

转载请注明原文地址:https://www.9cbs.com/read-120228.html

New Post(0)