CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 email a new record and add it to the database

Print topic Send  topic

Author Message
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.
View profile  Send private message
Aamir
Posted: 06/21/2005, 1:56 AM

Try using:

If Letter_Requests.To_Be_Faxed.CheckedValue Then

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.