close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Sub Routine Call From Mail Body Fails?

Thread began 2/01/2011 3:48 pm by wayne14102 | Last modified 2/03/2011 5:48 pm by wayne14102 | 2881 views | 8 replies

wayne14102

Sub Routine Call From Mail Body Fails?

I've been running this sub routine for my order emails. 'Get cart details and format for mail message.
sub shoporder(placeorder)

'Get cart contents and split fields
ProductID = split(request.form("Product Code"), ",")
Quantity = split(request.form("Quantity"), ",")
ProductName = split(request.form("Product Name"), ",")
UnitPrice = split(request.form("Price"), ",")
LineTotal = split(request.form("Line Total"), ",")
GrandTotal = request.Form("Total")

'Get customer billing details
PaymentMethod = request.Form("PayType")
Cardholder = request.Form("Cardholder")
Card_Number = request.Form("CCCardNumber")
BillingAddress = request.Form("Billing Address")
BillingZip = request.Form("Billing Zip")
ExpDate = request.Form("Exp Date")

' Get customer contact details
CustName = request.Form("Name")
CustEmail = request.Form("email")

' Format mail body
mailbody = mailbody & "<table width=" & Chr(34) & "650" & Chr(34) & " border=" & Chr(34) & "0" & Chr(34) & " cellpadding=" & Chr(34) & "5" & Chr(34) & " cellspacing=" & Chr(34) & "0" & Chr(34) & ">"
mailbody = mailbody & "<tr><td colspan=" & Chr(34) & "5" & Chr(34) & " class=" & Chr(34) & "spectable" & Chr(34) & ">Order Details</td><tr>"
mailbody = mailbody & "<tr><td colspan=" & Chr(34) & "3" & Chr(34) & ">"
MailBody = MailBody & "Order Number: " & Session("OrderID") & "<br>"
mailbody = mailbody & "Credit Card: " & PaymentMethod & "<br>"
mailbody = mailbody & "Name on Card: " & Cardholder & "<br>"
mailbody = mailbody & "Card Number: " & Card_Number & "<br>"
mailbody = mailbody & "Billing Address: " & BillingAddress & "<br>"
mailbody = mailbody & "Billing Zip: " & BillingZip & "<br>"
mailbody = mailbody & "Expiration Date : " & ExpDate & "<br>"
mailbody = mailbody & "</td>"
mailbody = mailbody & "<td colspan=" & Chr(34) & "2" & Chr(34) & " valign=" & Chr(34) & "top" & Chr(34) & ">"
MailBody = MailBody & "Customer Name: " & CustName & "<br>"
mailbody = mailbody & "Customer Email: " & CustEmail & "<br><br>"
mailbody = mailbody & "</td></tr><tr>"
mailbody = mailbody & "<td class=" & Chr(34) & "smallboldhlt" & Chr(34) & ">Quantity</td>"
mailbody = mailbody & "<td class=" & Chr(34) & "smallboldhlt" & Chr(34) & ">Product</td>"
mailbody = mailbody & "<td class=" & Chr(34) & "smallboldhlt" & Chr(34) & ">Product Code</td>"
mailbody = mailbody & "<td class=" & Chr(34) & "smallboldhlt" & Chr(34) & ">Price</td>"
mailbody = mailbody & "<td align=" & Chr(34) & "right" & Chr(34) & " class=" & Chr(34) & "smallboldhlt" & Chr(34) & ">Extended Price</td></tr>"

for i = 0 to ubound(Quantity)
mailbody = mailbody & "<tr class=" & Chr(34) & "normalsmall" & Chr(34) & "><td>"
mailbody = mailbody & Quantity(i) & "<br>"
mailbody = mailbody & "</td><td>"
mailbody = mailbody & ProductName(i) & "<br>"
mailbody = mailbody & "</td><td>"
mailbody = mailbody & ProductID(i) & "<br>"
mailbody=mailbody & "</td><td>"
mailbody = mailbody & UnitPrice(i) & "<br>"
mailbody = mailbody & "</td><td align=" & Chr(34) & "right" & Chr(34) & ">"
mailbody = mailbody & LineTotal(i) & "<br></td>"
next

mailbody = mailbody & "<tr><td colspan=" & Chr(34) & "5" & Chr(34) & "><hr class=" & Chr(34) & "blackrule" & Chr(34) & "</td></tr>"
mailbody = mailbody & "<tr class=" & Chr(34) & "smallspecialbold" & Chr(34) & ">"
mailbody = mailbody & "<td>Grand Total:</td>"
mailbody = mailbody & "<td>&nbsp;</td>"
mailbody = mailbody & "<td>&nbsp;</td>"
mailbody = mailbody & "<td>&nbsp;</td>"
mailbody = mailbody & "<td align=" & Chr(34) & "right" & Chr(34) & ">"
mailbody = mailbody & GrandTotal
mailbody = mailbody & "</td>"
mailbody = mailbody & "</tr>"
mailbody = mailbody & "</table>"
mailbody = mailbody & "<hr>"

end sub

I've been calling is from the mail body like so:

MailBody = MailBody & " Special Instructions:" & SpecialInstructions & "</p>"
shoporder(placeorder)
MailBody = MailBody & "" & vbCrlf & ""

I am switching all my mail code over to WA and when I run the page I get an email without the sub routine content. It doesn't crash. It just doesn't work. What's the work around?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...