Solved

Form Submit.

Posted on 2002-06-28
2
247 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 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