Solved

Form Submit.

Posted on 2002-06-28
2
238 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
ID: 7117548
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
ID: 7117659
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

12 Experts available now in Live!

Get 1:1 Help Now