Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2004, 07:01 AM
Authorized User
 
Join Date: Sep 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nitin_sharma Send a message via Yahoo to Nitin_sharma
Default SendEmail

Hi Guys,
I am trying to send email in one of my code , but the email need to be sent to the list of people which comes from a store procedure.

Then I change the recordset into a string containing all the email ids.
The only thing I am getting problem is in what format do I need to write the following syntax:
sendmail.To = stringname
Is this the right way , if not can anyone pls tell me the right one.
cheers

 
Old November 17th, 2004, 07:12 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Multiple recipients on the list are separated by semicolons:
sendmail.To = "[email protected];[email protected];[email protected]"


Om Prakash
 
Old November 17th, 2004, 07:15 AM
Authorized User
 
Join Date: Sep 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nitin_sharma Send a message via Yahoo to Nitin_sharma
Default

Ya I know that email id are separated by ";" but it is in a string
as
str = [email protected];[email protected]

And I need to present this in the sendmail.TO thing.

It doesnt work if I simply says:
sendmail.To = str.

Any advice?

 
Old November 20th, 2004, 05:31 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

It doesn't matter if the data is in a string or hardcoded. If you specify the list in "To" field, then it will send mail to multiple receipients. Please check the following example:

<%
Dim objNewMail

Set objNewMail = Server.CreateObject("CDONTS.NewMail")
str = "[email protected];[email protected]"
objNewMail.From = "[email protected]"
objNewMail.To = str

objNewMail.Subject = "This is a test Mail"
objNewMail.Body = "This is the Body text of this test mail."
objNewMail.Send

Set objNewMail = Nothing
Response.Write "Email has been sent"
%>

The source of str variable can be anything.
you can send mail to 2 recepients using above code..

Om Prakash
 
Old November 22nd, 2004, 06:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Multiple recipients on the list are separated by semicolons:
I believe that is COMMA, not semicolon.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
sendEmail Function in DTS gemispence SQL Server 2000 0 February 21st, 2006 05:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.