Syntax error with Sub procedure
What's wrong with this syntax on line 156 ?
This script works on another page where I don't use WA_UEmail.
Geert.
What's wrong with this syntax on line 156 ?
This script works on another page where I don't use WA_UEmail.
Geert.
you have the sub defined inside of the function WA_Universal_Email_1_SendMail(RecipientEmail) code.
a sub cannot be defined inside of a function, you will need to move the sub routine code outside of the function code.
And how can I get/use then the value (from that script) that I need in the WA_UEmail ?
You have to add the values to the MailBody string:
Public MailBody
Sub OddEvenNumber(iNumber)
If iNumber MOD 2 = 0 Or varBTWnr > "0" Then
MailBody = MailBody & IBAN : BE02 9793 3516 7640
Else
MailBody = MailBody & IBAN : BE11 9730 2045 8748
End If
End Sub
Sorry, but I don't understand how to do this.
I tried a few things in vain.
what your trying to do really doesn't need a sub routine.
from your original page, change this code:
varPostcode=Left((rsUsers.Fields.Item("Postcode").Value),2) 'geeft linkse 2 getallen
varBTWnr=(rsUsers.Fields.Item("BTWnummer").Value)
Call OddEvenNumber(varPostcode)
Sub OddEvenNumber(iNumber)
If iNumber MOD 2 = 0 Or varBTWnr > "0" Then
Response.write ("IBAN : BE02 9793 3516 7640")
Else
Response.write ("IBAN : BE11 9730 2045 8748")
End If
End Sub
to:
varPostcode=Left((rsUsers.Fields.Item("Postcode").Value),2) 'geeft linkse 2 getallen
varBTWnr=(rsUsers.Fields.Item("BTWnummer").Value)
If varPostcode MOD 2 = 0 Or varBTWnr > "0" Then
MailBody = MailBody & "IBAN : BE02 9793 3516 7640"
Else
MailBody = MailBody & "IBAN : BE11 9730 2045 8748"
End If
you're over complicating it by using the sub routine.
Glad to hear it is working.
After a while, it seems that there is something wrong. A lot of mails only give the first option (IBAN : BE02 9793 3516 7640). I get the right copy (BCC), but the customer receives the wrong one.
Can't I solve this in another way ?
E.g. : two different Universal Email, one for each option.
Geert.
loooking closely at your page, you already have wo instances of universal email applied to the page.
The first instance is sending the message to the customer, the second instance is sending the message to you, but the mail body's of the two instances are not the same, this is why you are receiving a different email than the customer.
either set both email bodys to be the same, or set one of the emails to bcc the other recipient.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.