Example of using JMail to specify multiple recipients in ASP

Source: Internet
Author: User

JMail is a Third-party messaging component, usually located on the Web server side, that works closely with the site program to receive and submit mail to the mail server's controls, giving the site the ability to send and receive messages.

The function of using JMail in ASP is the following:

The code is as follows Copy Code
Sub sendaction (Subject,mailaddress,tomail,content,fromemail,fromer,username,password)
Set ojmail=createobject ("Jmail.message")
Ojmail.logging=true
Ojmail.silent=false
ojmail.priority = 1
Ojmail.fromname=fromer
Ojmail.from= Fromemail
ojmail.charset= "gb2312"
Ojmail.mailserverusername = UserName
Ojmail.mailserverpassword = PassWord
ojmail.contenttransferencoding = "Base64"
Ojmail.htmlbody = Content ' Message contents
Ojmail.body =content ' "Our messages are in HTML format, but your mail viewing software may not support
' Single address recipient
Ojmail.addrecipient Tomail ' recipient address
Ojmail.subject = Subject ' title
Ojmail.send (MailAddress)
End Sub

To be specified in an ASP program and submitted to JMail processing
Often needs to be sent to multiple addressee mailboxes.
As follows:

The code is as follows Copy Code

Jmail.addrecipient "Somebody1@somewhere.com"
Jmail.addrecipient "Somebody2@somewhere.com"
Jmail.addrecipient "Somebody3@somewhere.com"

As far as I know, you should not, you can use a loop to set.

  code is as follows copy code


Aryemail = Split ("aa@bb.com;adf@sfda.net;dsfafdsa@china.com", ";")
for I=0 to UBound (aryemail)
  jmail.addrecipient Trim (Aryemail (i))
Next

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.