Solved

Form Submit.

Posted on 2002-06-28
2
236 Views
Last Modified: 2012-06-22
Hi Experts

Once a form is submitted, how can I send details of that form in the body of an email?
Is it also possible to send those details as Fax?

Thank you
0
Comment
Question by:Hafez
2 Comments
 
LVL 18

Accepted Solution

by:
mgfranz earned 100 total points
Comment Utility
An email is simple;

Sub send_mail(toaddress, subject, bodytext)
' The code below is set to use CDO
<%
Set objCDO = Server.CreateObject("CDO.Message")
   With objCDO
        .To       = toaddress
        .From     = "sales@abc.com"
        .Subject  = subject
        .TextBody = bodytext
        .Send
   End With

On Error Resume Next
'Mail.Send
If Err <> 0 Then
     Response.Write "Error encountered: " & Err.Description
'Else
     'Response.Write "Message Sent"
End If

Set objCDO = Nothing
'Set Mail = Nothing

End Sub

dfname = Request("fName")
strFrom = Request("from")
tracking = Request("fed_Track")

body1="Dear " & dfname&"," & VbCrLf &VbCrLf & "Thank you for shopping at ABC.COM.  We have shipped your order via FedEx."  & VbCrLf  & VbCrLf
     body3="Your FedEx order tracking number is " & tracking&"."  & VbCrLf  & VbCrLf
     body4="Please use this number when visiting FedEx.com to track your order." & VbCrLf & VbCrLf

     strBody = body1 + body3 + body4

     send_mail rsorder("email"), strFrom, strBody
%>

Sending a Fax is going to be tougher...  There are a few software applications that can do this, but I have never played with any of them.
0
 
LVL 2

Expert Comment

by:rdmjrb
Comment Utility
This site details how to use CDONTS to send emails from forms using the built-in (IIS 4.0 +) NewMail dll.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q186204

If you are an ASPTODAY member they have an excellent article on how to do this and configure IIS.

The code will run on most IIS web servers (hosted) and if you have your own then you wil need to configure it with a valid SMTP mail server, as both articles specify.

To send to a fax is a little more tricky. I have been successful by doing the following:
1. Send a successful email.
2. Get a standard account at eFax.com - very cheap (or another similar site you find)
3. eFax gives you an email address that you can use to send faxes.
4. Use this email account in your application, pass in the fax number you wish to fax to and send it out like a normal email.

I will send you the code I specifically used if you like but that is the basics of the application. By eFax giving you an email account, anything that is sent here will be faxed. That's the beauty, it's a work-around, and its not so clean but it works.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now