Forums

ASP

This topic is locked

Email to multiple recipients?

Posted 18 Jun 2002 18:47:43
1
has voted
18 Jun 2002 18:47:43 Rian Carstens posted:
I know that using CDONTS you can send an email to multiple people by just adding 2 email address in the to field. But how do I send 2 emails to 2 different emaill address on the same page?

Let me explain a bit more, I need to tell a product seller that his product has been bought by a customer off my site and I have to send a similliar email to the customer confirming what he just bought. Can you do this with using 2 CDONTS on the same page or do you alter the body and to tags slightly?

Any help would be greatly appreciated.

Cheers

Rian

Replies

Replied 19 Jun 2002 09:12:53
19 Jun 2002 09:12:53 Viktor Farcic replied:
Just repeat the code.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I know that using CDONTS you can send an email to multiple people by just adding 2 email address in the to field. But how do I send 2 emails to 2 different emaill address on the same page?

Let me explain a bit more, I need to tell a product seller that his product has been bought by a customer off my site and I have to send a similliar email to the customer confirming what he just bought. Can you do this with using 2 CDONTS on the same page or do you alter the body and to tags slightly?

Any help would be greatly appreciated.

Cheers

Rian
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic
www.farcic.com
TalkZone Manager
Replied 19 Jun 2002 09:13:02
19 Jun 2002 09:13:02 Viktor Farcic replied:
Just repeat the code.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I know that using CDONTS you can send an email to multiple people by just adding 2 email address in the to field. But how do I send 2 emails to 2 different emaill address on the same page?

Let me explain a bit more, I need to tell a product seller that his product has been bought by a customer off my site and I have to send a similliar email to the customer confirming what he just bought. Can you do this with using 2 CDONTS on the same page or do you alter the body and to tags slightly?

Any help would be greatly appreciated.

Cheers

Rian
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic
www.farcic.com
TalkZone Manager
Replied 19 Jun 2002 09:34:08
19 Jun 2002 09:34:08 Rian Carstens replied:
<pre id=code><font face=courier size=2 id=code> &lt;%
Set MailObj = Server.CreateObject("CDONTS.NewMail"
MailObj.From = " "
MailObj.To = " "
MailObj.To = " "
MailObj.Cc = ""
MailObj.Bcc = ""
MailObj.Subject = "Sellers copy"
MailObj.Subject = "Buyers copy"
MailObj.Importance = 2

Dim BuyersCopy

BuyersCopy = "Hallo Mr Buyer" & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "Thank you for buying this product from us." & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "The product will be shipped in 5 working days." & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "Thank you." & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "The Casa Particular .com team."

Dim SellersCopy

SellersCopy = "Hallo Mr Seller" & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "Your product has been sold on our site." & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "The money will be paid in 5 working days." & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "Thank you." & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "The Casa Particular .com team."

MailObj.Body = SellersCopy
MailObj.Body = BuyerCopy
MailObj.Send
%&gt;
</font id=code></pre id=code>

Basicly I would like to be able to automaticly send an email to my seller stating that his product has been bought on the site. Then I would like to have a similiar email go out to the Buyer who has just bought the product - his invoice. The difference between the Buyer email and the seller email is in the "to" field where the email addresses will be different but also in the "body" field where there will be more info for the seller than there is for the Buyer.

Thank you

Rian

hey, I'm still learning!?!
Replied 20 Jun 2002 01:25:17
20 Jun 2002 01:25:17 Andrew Watson replied:
<pre id=code><font face=courier size=2 id=code>
&lt;%
Set MailObjBuyer = Server.CreateObject("CDONTS.NewMail"
MailObjBuyer.From = " "
MailObjBuyer.To = " "
MailObjBuyer.Cc = ""
MailObjBuyer.Bcc = ""
MailObjBuyer.Subject = "Buyers copy"
MailObjBuyer.Importance = 2
Dim BuyersCopy
BuyersCopy = "Hallo Mr Buyer" & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "Thank you for buying this product from us." & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "The product will be shipped in 5 working days." & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "Thank you." & vbCrLf & vbCrLf
BuyersCopy = BuyersCopy & "The Casa Particular .com team."
MailObjBuyer.Body = BuyersCopy
MailObjBuyer.Send

Set MailObjSeller = Server.CreateObject("CDONTS.NewMail"
MailObjSeller.From = " "
MailObjSeller.To = " "
MailObjSeller.Cc = ""
MailObjSeller.Bcc = ""
MailObjSeller.Subject = "Sellers copy"
MailObjSeller.Importance = 2
Dim SellersCopy
SellersCopy = "Hallo Mr Seller" & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "Your product has been sold on our site." & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "The money will be paid in 5 working days." & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "Thank you." & vbCrLf & vbCrLf
SellersCopy = SellersCopy & "The Casa Particular .com team."
MailObjSeller.Body = SellersCopy
MailObjSeller.Send
%&gt; </font id=code></pre id=code>

:: Son, im Thirty.... ::
Replied 21 Jun 2002 13:01:31
21 Jun 2002 13:01:31 Rian Carstens replied:
Thanks Leed

It works and it works well. I didnt even think it could be that simple.

Now that I can send to the buyer and the seller at the same time there is another problem arrising. How can I send to multiple sellers at the same time based on the products that the buyer buys?

Here is my code at the moment, as you can see I use UltraCartII:
<pre id=code><font face=courier size=2 id=code>
&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="../Connections/connCasa.asp" --&gt;
&lt;!--#include file="UCII_Cart.asp"--&gt;
&lt;%
' UltraDev Shopping Cart II
' Copyright (c) 2001 Joseph Scavitto All Rights Reserved
' www.thechocolatestore.com/ultradev
Dim UCII_CartColNames,UCII_ComputedCols,UCII__i
UCII_CartColNames = Array("Deposit","Deposit total","House","ProductID","Quantity","RoomNo","Coments","TimeOfArival","Airline","FlightNo","Taxi","ToDate","FromDate","People","Price","District","Province","Customer Email","Customer Name","Owner","Total"
UCII_ComputedCols = Array("","Deposit","","","","","","","","","","","","","","","","","","","Price"
Set UCII = VBConstuctCart("UCartII",0,UCII_CartColNames,UCII_ComputedCols)
UCII__i = 0
%&gt;
&lt;%
Dim qryOrders__MMColParam
qryOrders__MMColParam = "0"
if (UCII.OrderID &lt;&gt; "" then qryOrders__MMColParam = UCII.OrderID
%&gt;
&lt;%
set qryOrders = Server.CreateObject("ADODB.Recordset"
qryOrders.ActiveConnection = MM_connCasa_STRING
qryOrders.Source = "SELECT * FROM OrdersQuery WHERE OrderID = " + Replace(qryOrders__MMColParam, "'", "''" + ""
qryOrders.CursorType = 0
qryOrders.CursorLocation = 2
qryOrders.LockType = 1
qryOrders.Open()
qryOrders_numRows = 0
%&gt;
&lt;%
Dim qryOrderDetails__MMColParam
qryOrderDetails__MMColParam = "0"
if (UCII.OrderID &lt;&gt; "" then qryOrderDetails__MMColParam = UCII.OrderID
%&gt;
&lt;%
set qryOrderDetails = Server.CreateObject("ADODB.Recordset"
qryOrderDetails.ActiveConnection = MM_connCasa_STRING
qryOrderDetails.Source = "SELECT * FROM OrderDetailsQuery WHERE OrderID = " + Replace(qryOrderDetails__MMColParam, "'", "''" + ";"
qryOrderDetails.CursorType = 0
qryOrderDetails.CursorLocation = 2
qryOrderDetails.LockType = 1
qryOrderDetails.Open()
qryOrderDetails_numRows = 0
%&gt;
&lt;%
' UltraCart II Redirect If Cart Empty Version 1.01
If (UCII.GetItemCount() &lt;= 0) Then
UCII_RedirectToPage = "../default.asp"
If false Then
Server.Transfer(UCII_RedirectToPage)
Else
Response.Redirect(UCII_RedirectToPage)
End If
End If
%&gt;
&lt;%
Set MailObjCustomer = Server.CreateObject("CDONTS.NewMail"
MailObjCustomer.From = " "
MailObjCustomer.To = " "
MailObjCustomer.Cc = ""
MailObjCustomer.Bcc = ""
MailObjCustomer.Subject = "Customers copy"
MailObjCustomer.Importance = 2

Dim CustomersCopy
CustomersCopy = "Hallo Mr Customer" & vbCrLf & vbCrLf
CustomersCopy = CustomersCopy & "Thank you for buying this product from us." & vbCrLf & vbCrLf
CustomersCopy = CustomersCopy & "The product will be shipped in 5 working days." & vbCrLf & vbCrLf
CustomersCopy = CustomersCopy & "Thank you." & vbCrLf & vbCrLf
CustomersCopy = CustomersCopy & "The Casa Particular .com team."

MailObjCustomer.Body = CustomersCopy
MailObjCustomer.Send
%&gt;
&lt;%
Set MailObjCasaOwner = Server.CreateObject("CDONTS.NewMail"
MailObjCasaOwner.From = " "
MailObjCasaOwner.To = " "
MailObjCasaOwner.Cc = ""
MailObjCasaOwner.Bcc = ""
MailObjCasaOwner.Subject = "CasaOwners copy"
MailObjCasaOwner.Importance = 2

Dim CasaOwnersCopy
CasaOwnersCopy = "Hallo Mr CasaOwner" & vbCrLf & vbCrLf
CasaOwnersCopy = CasaOwnersCopy & "Your product has been sold on our site." & vbCrLf & vbCrLf
CasaOwnersCopy = CasaOwnersCopy & "The money will be paid in 5 working days." & vbCrLf & vbCrLf
CasaOwnersCopy = CasaOwnersCopy & "Thank you." & vbCrLf & vbCrLf
CasaOwnersCopy = CasaOwnersCopy & "The Casa Particular .com team."

MailObjCasaOwner.Body = CasaOwnersCopy
MailObjCasaOwner.Send
%&gt;
</font id=code></pre id=code>

I have multiple sellers that sell products on my site and I would like to send an individual email like above to each seller stating that their product(s) have been sold. The one seller should not receive a list products in the order, but only the product that belongs to him.

Sorry for the long post, but in previous posts I have not made myself very clear.

Thanks

Rian

hey, I'm still learning!?!
Replied 21 Jun 2002 14:54:42
21 Jun 2002 14:54:42 Andrew Watson replied:
If you have a recordset of all the concerned sellers then just loop through them sending a mail to each...

<pre id=code><font face=courier size=2 id=code>
While not rsSellers.Eof Then
'send sellers email code'
rsSellers.Movenext
Wend
</font id=code></pre id=code>

Cheers
Leed

:: Son, im Thirty.... ::
Replied 21 Jun 2002 14:55:53
21 Jun 2002 14:55:53 Andrew Watson replied:
oh, you might want to set both mail objects to nothing after sending them, !

:: Son, im Thirty.... ::
Replied 28 May 2007 23:27:59
28 May 2007 23:27:59 Bars Bars replied:
Code for cyrillic alfabet for CDONTS.NewMail ?
Where I set
"objSession.SetLocaleIDs(CodePageID)" ?
Please, Help me!

Replied 12 Jun 2007 10:41:47
12 Jun 2007 10:41:47 nicholaskirk11 nicholaskirk11 replied:

Reply to this topic