Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send email thru JMail to multiple recipients (from BCC field)?

Status
Not open for further replies.

arshawn

Programmer
Feb 6, 2002
1
US
i can send email to recipient and BCC for simgle email address. but i cannot find related document on sending email to multiple email addresses (or a mailing list). any help?
 
try placing a colon between addresses

bcc = "email@email.com; email@email.com; email@email.com"

hope that helpse
 
I had the same problem.

Here's my code and it actually works! ;-)

The form-field "ToBBC" contained all the e-mail addresses seperated by a ","

******************************************************

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>

<%
varToEmailBBC = Request.form(&quot;ToBBC&quot;)
varSubject = Request.form(&quot;Subject&quot;)
varFromName = Request.form(&quot;FromName&quot;)
varFromEmail = Request.form(&quot;FromEmail&quot;)
varMessage = Request.form(&quot;Message&quot;)
varHowMany = Request.form(&quot;HowMany&quot;)

' I later use the following variable for seperating the e-mails
varString = varToEmailBBC

Name = varFromName
SenderEmail = varFromEmail
Subject = varSubject
Body = varMessage

Set JMail = Server.CreateObject(&quot;JMail.SMTPMail&quot;)

'the name of your smtp-server
JMail.ServerAddress = &quot;XXX.XXXX.XX&quot;

JMail.Sender = Senderemail
JMail.Subject = Subject

response.write &quot;Mail sent to:&quot;

'for loop which adds all the recipient in the JMail-script
For i = 1 to varHowMany

SearchStr = &quot;,&quot;
'MyPos = InstrRev(varString, SearchStr, -1, 1)
MyPos = Instr(1, varString, SearchStr, 0) - 1
MyString = Len(varString)
LeftString = Left(varString, MyPos)

JMail.AddRecipientBCC LeftString

RCount = Mystring - MyPos - 1
MyStr = Right(varString, RCount)

response.write &quot;<br>&quot;
response.write LeftString

varString = MyStr

Next

'****************

JMail.Body = Body
JMail.Priority = 3
JMail.AddHeader &quot;Originating-IP&quot;, Request.ServerVariables(&quot;REMOTE_ADDR&quot;)
JMail.Execute

%>


****************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top