Solved

Form Submit.

Posted on 2002-06-28
2
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 informatio…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 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