This topic is locked

Send Email After Record Added

9/20/2011 2:55:44 AM
ASPRunnerPro General questions
BeachyLife author

Is it possible to pass the field values back in an email after the record has been added. I save the user's first and last name as session variables, along with their email address and interview date and I'd like to send these back to the user in a confirmation email. I'm sending the html email and it works fine except when I try to insert the session variables, then I get syntax errors. I'd like to send the user their interview date in the`email Can anyone help me? Thanks!
'** Send simple email ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
dim tmpDict

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=Session("Email")

tmpDict("bcc")="HRdept@xxxxxxx.com"

tmpDict("subject")="Confirming Your Interview With Dyna Air"

tmpDict("htmlbody")="<body><p>Thank You For Your Interest In Dyna Air. Your application has been received and your interview has been scheduled. We look forward to meeting you. Please dress professionally, bring your resume and arrive 5-10 minutes early.

Our Address Is:
xxxxx
1802 Main Blvd.
Anytown, CA 99999
</p><p>If you are unable to keep your appointment, please call our office at 999-999-9999 to reschedule.</p></body></html>"

set ret=runner_mail(tmpDict)

if not ret("mailed") then

response.write ret("message")

end if
'** Redirect to another page ****

Response.Redirect "/thankyou.asp"

jadachDevClub member 9/20/2011

This works for me,
set params = CreateObject("Scripting.Dictionary")

params("to")=Session("Email")

params("bcc")="HRdept@xxxxxxx.com"

params("subject")="Confirming Your Interview With Dyna Air"

params("htmlbody")="<html><body><p>Thank You " & session("FirstName") & " " & session("LastName") & " For Your Interest In Dyna Air. Your application has been received and your interview has been scheduled. We look forward to meeting you. Please dress professionally, bring your resume and arrive 5-10 minutes early.

Our Address Is:
xxxxx
1802 Main Blvd.
Anytown, CA 99999
</p><p>If you are unable to keep your appointment, please call our office at 999-999-9999 to reschedule.</p></body></html>"

params("charset")="UTF-8"

runner_mail(params)

BeachyLife author 9/20/2011



This works for me,
set params = CreateObject("Scripting.Dictionary")

params("to")=Session("Email")

params("bcc")="HRdept@xxxxxxx.com"

params("subject")="Confirming Your Interview With Dyna Air"

params("htmlbody")="<html><body><p>Thank You " & session("FirstName") & " " & session("LastName") & " For Your Interest In Dyna Air. Your application has been received and your interview has been scheduled. We look forward to meeting you. Please dress professionally, bring your resume and arrive 5-10 minutes early.

Our Address Is:
xxxxx
1802 Main Blvd.
Anytown, CA 99999
</p><p>If you are unable to keep your appointment, please call our office at 999-999-9999 to reschedule.</p></body></html>"

params("charset")="UTF-8"

runner_mail(params)



Thank you so much! That did it. Now I have another question for you. I'm trying to put a link to mapquest in the body, but am getting vbscript error. Here's what I have:
** Send simple email ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
dim tmpDict

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=Session("Email")

tmpDict("bcc")="HRdept@xxxxxxxx.com"

tmpDict("subject")="Confirming Your Interview With Dyna Air on " & session("Interview_DDT") & " "

tmpDict("htmlbody")="<p>Hello " & session("First") & " " & session("Last") & "</p>
<p>Thank You For Your Interest In Dyna Air. Your application has been received and your interview has been scheduled for " & session("Interview_DDT") & ". We look forward to meeting you. Please dress professionally, bring your resume and arrive 5-10 minutes early.

Our Address Is:
Dyna Air
9999 xxxxxx Blvd.
Glendale, CA 91201</p>"<a href="http://mapq.st/mTkYkW">map"</a>;

<p>Your Interview Date: " & session("Interview_DDT") & "

</p><p>If you are unable to keep your appointment, please call our office at 999-999-9999 to reschedule.</p></body></html>"
set ret=runner_mail(tmpDict)

if not ret("mailed") then

response.write ret("message")

end if
'** Redirect to another page ****

Response.Redirect "/thankyou.asp"

jadachDevClub member 9/22/2011

Try getting rid of the "s
Use just <a href="http://mapq.st/mTkYkW">map</a>;