ASP Mail - Multiple emails (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


search -> ASP Mail - Multiple emails (3/23/2001 20:55:00)

I use ASP Mail and it works fine, but I want to generate a Database results region that has multiple email address' and then send the address'from a form to a page named broadcast.asp. Broadcast.asp has the ASP mail component that I want to send the same message to each individual email address. What happens is that it adds all the email information(from name, to name, from address) to one email and sends it to the first recipient. Here is the ASP MAIL code I am using:<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
'set the properties
Mailer.FromName = "careersearchweb.com"
Mailer.FromAddress = "admin@careersearchweb.com"
Mailer.AddRecipient Request.form("FirstName"),Request.Form("AppEmail")
Mailer.AddBCC "Chris Hansen", "admin@careersearchweb.com"
Mailer.RemoteHost = "careersearchweb.com"
Mailer.Subject = "New job posting sent from " & Request.form("Contact") & " at " & Request.form("Company")
Mailer.BodyText = "Hello " & Request.form("FirstName") & " " & Request.form("LastName") & "," & VbCrLf & Request.form("Email") & " sent you this job posting from careersearchweb.com" & VbCrLf & VbCrLf & Request.form("Page") & Request.form("JobNumber") & VbCrLf & VbCrLf & "Follow this link or copy and paste the URL into the address field in your web browser."
' send the mail
if Mailer.SendMail then
Response.Write "Mail Sent"
Else
Response.Write "Mail not sent" & Mailer.Response
End if
%>
What am I doing wrong?




Spooky -> RE: ASP Mail - Multiple emails (3/23/2001 14:52:00)

You say you are sending to a result generated from a database?

Are you sending the email to 1 address inputted by a form? or multiple email addresses extracted from a database.

You lost me a bit when you mentioned the form post.

You would need to be performing some sort of loop, but this is reliant on what input you have, either by form or database

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!





search -> RE: ASP Mail - Multiple emails (3/23/2001 15:30:00)

Thanks for responding spooky

Yes, I am sending results generated by a database.

Yes, multiple email addresses extracted from a database.






Spooky -> RE: ASP Mail - Multiple emails (3/23/2001 16:38:00)

So each person in the database receives a note?
Add the email script between the DRW dividers.

As each loop of the DRW is completed, an email will be sent to the unique email address supplied with each record.

Instead of Request.form("FirstName"),Request.Form("AppEmail")
you will use the database column value for email / first name

Thats using the FieldVal(fp_rs("")) that does the actual writing of values.





search -> RE: ASP Mail - Multiple emails (3/24/2001 13:24:00)

Thanks again Spooky.

I don't know what you mean by dividers so I attached the DRW. Can you tell me where to put the ASP Mail?

Thanks


<!--#include file="../../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Applications WHERE (CState = '::State::' AND JobTitle = '::JobTitle::' OR CState = '::State::' AND CJob1 = '::JobTitle::' OR CState = '::State::' AND CJob2 = '::JobTitle::' OR CState = '::State::' AND CJob3 = '::JobTitle::' OR CState = '::State::' AND CJob4 = '::JobTitle::' OR CState = '::State::' AND CJob5 = '::JobTitle::')"
fp_sDefault="State=&JobTitle=&State=&JobTitle=&State=&JobTitle=&State=&JobTitle=&State=&JobTitle=&State=&JobTitle="
fp_sNoRecords="No records returned."
fp_sDataConn="JobSearch"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="FirstName"
fp_sMenuValue="FirstName"
fp_iDisplayCols=139
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<table BORDER="0">
<tr>
<td><b>FirstName:</b></td>
<td><input NAME="FirstName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"FirstName")%>"></td>
</tr>
<tr>
<td><b>LastName:</b></td>
<td><input NAME="LastName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"LastName")%>"></td>
</tr>
<tr>
<td><b>AppEmail:</b></td>
<td><input NAME="AppEmail" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"AppEmail")%>"></td>
</tr>
<tr>
<td><b>Email:</b></td>
<td><input NAME="Email" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Email")%>"></td>
</tr>
</table>
<!--#include file="../../_fpclass/fpdbrgn2.inc"-->





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
3.198242E-02