February 17th, 2011, 12:08 AM
ASPEmail- Can I pass parameters using AppendBodyFromFile
I have an application where I need to email an order confirmation to the customer. I use Persits ASPMail for basic emails and in this case, I want to use the # AppendBodyFromFile method to send my standard Order Confirmation. It is an ASP form with VB script that connects to an SQL Server 2008 table to pull the order info.
Problem is, I need to pass the parameters of Customer Number and Order Number to the Order Confirmation. I can't use session variables to pass the info since the email is no longer associated with this session. So, I thought I would do so via URL Parameters such as:
strBodyPath = Server.MapPath(".") & "\Order_Confirmation.asp"
?Login_Contact_ID=" & Customer_Contact_ID _
& "&client_id=" & client_id _
& "&role=" & role _
& "¤t_emailer=" & allocation_code
Mail.Send ' send message
However, it seems like you are not allowed to pass params in ASPMail. Since there are thousands of applications that are emailing order confirmations, there must be a method to passing along necessary info to the email form but I am at a loss how to do so. Please help.
February 17th, 2011, 09:25 PM
I've never used persits, but they have support that could probably help you out.
Why don't you just build the message body with the request variables inserted in the string?
Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
February 18th, 2011, 01:36 AM
Originally Posted by Doug G
Thanks for the response. I think you are on the right track. I can't use static text, it needs to be it's own form but like you mentioned, I can insert the info into the source code.
Thanks for taking the time to answer the question, you are always a great help.