Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I send a fax using ASP.

Status
Not open for further replies.

martindavey

Programmer
Jan 2, 2000
122
GB
I can send email using ASP, but how do I send a FAX?

I want the user to be able to click on a button, and the fax get sent automatically to a stored number.

Thanks, Martin Davey.

PS. If you know a way that doesn't involve ASP then please also let me know.
 
I would really like to know how to send an email using asp. If you have the time to help an enthusiastic college student, then please let me know how.

Thanks.
RBP
 
sparky111,
take a look at CDONTS (search the microsoft site)

nick bulka

 
Sending Email from the Server using ASP.

Sending email through Active Server Pages is not a difficult task. All you need is the Collaborative Data Object, which ships with NT Option Pack 4. To make sure you have it installed, go to Start / Control Panel / Add/Remove Programs / NT Option Pack 4, and see if the SMTP Piece has been installed. If it is *not* installed, you will get an error when you try to run the code, shown below (the error will read something like, "Invalid class string").

eg:-
<%
MsgFrom = Request.Form(&quot;EmailTextBox&quot;)
MsgTo = &quot;fred@flintstone.com;barny@flintstone.com&quot;
MsgSubject = &quot;Happy Christmas&quot;
MsgMessage = &quot;Hi there Fred/Barny...&quot; &amp; vbcrlf _
&amp; &quot;Give me regards to the Betty/Wilma.&quot;
MsgImportance = 0 'Low

Set objNewMail = CreateObject(&quot;CDONTS.NewMail&quot;)
objNewMail.Send MsgFrom,MsgTo,MsgSubject,MsgMessage,MsgImportance
%>


If you don't have CDONTS installed then you need to find out what email software your host provides.

The following example uses ASPMail:-

<FORM METHOD=&quot;POST&quot; ACTION=&quot;formToEmail.asp&quot;>
<PRE>
Message Recipient: <INPUT SIZE=30 NAME=&quot;recipient&quot; MAXLENGTH=200>
<P>
Message Sender: <INPUT SIZE=30 NAME=&quot;sender&quot; MAXLENGTH=200>
<P>
Subject: <INPUT SIZE=30 NAME=&quot;subject&quot; MAXLENGTH=512>
<P>
First Line Of Message: <TEXTAREA ROWS=2 COLS=60 NAME=&quot;messageline1&quot;> </TEXTAREA>
<P>
Second Line Of Message: <TEXTAREA ROWS=2 COLS=60 NAME=&quot;messageline2&quot;> </TEXTAREA>
</PRE>
<INPUT TYPE=submit VALUE=&quot; Send &quot;>


then create the ASP file formToEmail.asp to receive the form, and send the email:

<%
Set mailer = Server.CreateObject(&quot;ASPMAIL.ASPMailCtrl.1&quot;)
recipient = Request.Form(&quot;recipient&quot;)
sender = Request.Form(&quot;sender&quot;)
subject = Request.Form(&quot;subject&quot;)
message = Request.Form(&quot;messageline1&quot;)
message = message &amp; vbCRLF
message = message &amp; vbCRLF
message = message &amp; Request.Form(&quot;messageline2&quot;)
mailserver = &quot;mail.wiredhosting.com&quot;
result = mailer.SendMail(mailserver, recipient, sender, subject, message)
%>
<% If &quot;&quot; = result Then %>
Mail has been sent.
<% Else %>
Mail was not sent, error message is
<H2>
<%= result %>
</H2>
<% End If %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top