Eric
Posts: 1
|
| Posted: 06/20/2005, 8:45 PM |
|
I know the email topic has been discussed numerous times but as novice user and someone with little knowledge of ASP I can't seem to be able to do this. In my application users will add a new record and if they select a checkbox for faxing it will send the data to someone to fax it to the customer. Now, when I add the email function to the OnClick events of the Add button it will just give the user an error page and wouldn't even add the record to the database. What am I doing wrong? Following is the function's code:
Dim strBody, strFrom, strTo, strSubject
'Send Email @32-C04FEBAF
strBody = "The following customer has requested the Letter to be faxed:"
strBody = strBody & vbCRLF & vbCRLF
strBody = strBody & "Customer Name: " & Letter_Requests.Name.Text & vbCRLF
strBody = strBody & "Account Number: " & Letter_Requests.Account_Number.Text & vbCRLF
strBody = strBody & "Wireless Number: " & Letter_Requests.Wireless_Number.Text & vbCRLF
strBody = strBody & "Fax Number: " & Letter_Requests.Fax_Number.Text & vbCRLF
strBody = strBody & "Date Requested: " & Now & vbCRLF
strBody = strBody & vbCrLf & vbCrLf & vbCrLf & "Thanks," & vbCrLf & "xy Department"
strFrom = "xy@company.com"
strTo = "john.doe@company.com"
strSubject = "Fax Request"
If Letter_Requests.To_Be_Faxed.Text = 1 then
With CreateObject("CDONTS.NewMail")
.From = strFrom
.To = strTo
.Subject = strSubject
.Body = strBody
.BodyFormat = 1
.MailFormat = 0
.Send
End With
End If
'End Send Email
The data is stored on a SQL server and the form name is "Letter_Requests".
Any help you can provide would be greatly appreciated.
|
 |
 |
Aamir
|
| Posted: 06/21/2005, 1:56 AM |
|
Try using:
If Letter_Requests.To_Be_Faxed.CheckedValue Then
|
|
|
 |
|