Help with Sendmail.asp
Re-invent ASP.NET Hosting Community
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Help with Sendmail.asp Expand / Collapse
Author
Message
Posted 8/2/2007 7:44:56 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/3/2007 6:26:47 AM
Posts: 2, Visits: 7
I could use some help with my code.  Warning:  I am a complete novice.

I had it working fine...  but then I added some extra fields and it crapped out on me.  I think the problem is in the asp file - but I included both.

Any ideas?

(FYI, I edited out some pertinent stuff with XXX)

Thank you!

--------------------------------------

<form action="sendmail.asp" method="post">

<input type="hidden" name value><table border="0" cellpadding="4" cellspacing="0"

width="608">

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Name</strong></font></td>

<td width="297"><input type="text" name="name" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Street Address&nbsp; </strong></font></td>

<td width="297"><input type="text" name="address1" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Town/City&nbsp; </strong></font></td>

<td width="297"><input type="text" name="address2" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>State&nbsp; </strong></font></td>

<td width="297"><input type="text" name="address3" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Zip&nbsp;</strong></font></td>

<td width="297"><input type="text" name="address4" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Day Time Phone</strong></font></td>

<td width="297"><input type="text" name="phone1" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Evening Phone</strong></font></td>

<td width="297"><input type="text" name="phone2" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Best time to reach you:</strong></font></td>

<td width="297"><input type="text" name="time" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>E-mail</strong></font></td>

<td width="297"><input type="text" name="email" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><b>Is this request for you or a family member?</b></font></td>

<td width="297"><input type="text" name="who" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><b>Which program is the student interested in trying?</b></font></td>

<td width="297"><input type="text" name="program" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><b>Does the student have previous experience in that area of study?&nbsp;&nbsp;<br> If so, please summarize.</b></td>

<td width="297"><input type="text" name="experience" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>What is the student's age?</strong></font></td>

<td width="297"><input type="text" name="age" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><b>How did you locate our website?</b></td>

<td width="297"><input type="text" name="how" size="41"></td>

</tr>

<tr>

<td width="307" align="right"><font face="Arial" size="2"><strong>Comments/Questions?</strong></font></td>

<td width="297"><input type="text" name="comments" size="41"></td>

</tr>

</table>

<table width="608">

<tr>

<td width="600" align="left">

<p align="center"><input type="submit" value="Submit">

<p>&nbsp;</p>

</td>

</tr>

</table>

</form>

-----------------------------------------------

<html>

<head>

<title></title>

</head>

<body bgcolor="#FFFFFF">

<%

name = request.form("name")

address1 = request.form("address1")

address2 = request.form("address2")

address3 = request.form("address3")

address4 = request.form("address4")

phone1 = request.form("phone1")

phone2 = request.form("phone2")

time = request.form("time")

email = request.form("email")

who = request.form("who")

program = request.form("program")

experience = request.form("experience")

age = request.form("age")

how = request.form("how")

comments = request.form("comments")

IF ((name="") or (email="")) THEN

ErrMsg = "Please enter your name and/or e-mail address"

ELSE

Set Mail = Server.CreateObject("Persits.MailSender")

Mail.Host = "mail.XXXXX.net"

Mail.From = "XXXXX@XXXX.com" 'Note: Must be someuser@yourdomain.com

Mail.FromName = "meghan"

' The User and Password below is required by ASPEmail to get by our SMTP Authentication

Mail.Username = "meghan"

Mail.Password = "XXXXXX"

Mail.AddAddress "meghan@XXXXXX.com", "Meghan"

Mail.AddReplyTo email

Mail.Subject = "website form"

BodyMsg = "Requested Information: " + Chr(10)

BodyMsg = BodyMsg + "Name = " & name & Chr(10)

BodyMsg = BodyMsg + "Address1 = " & address1 & Chr(10)

BodyMsg = BodyMsg + "City = " & address2 & Chr(10)

BodyMsg = BodyMsg + "State = " & address3 & Chr(10)

BodyMsg = BodyMsg + "Zip = " & address4 & Chr(10)

BodyMsg = BodyMsg + "Phone1 = " & phone1 & Chr(10)

BodyMsg = BodyMsg + "Phone2 = " & phone2 & Chr(10)

BodyMsg = BodyMsg + "Time = " & time & Chr(10)

BodyMsg = BodyMsg + "Email = " & email & Chr(10)

BodyMsg = BodyMsg + "Who = " & who & Chr(10)

BodyMsg = BodyMsg + "Program = " & program & Chr(10)

BodyMsg = BodyMsg + "Experience = " & experience & Chr(10)

BodyMsg = BodyMsg + "Age = " & age & Chr(10)

BodyMsg = BodyMsg + "How = " & how & Chr(10)

BodyMsg = BodyMsg + "Comments = " & comments & Chr(10)

Mail.Body = BodyMsg

On Error Resume Next

Mail.Send

If Err <> 0 Then

ErrMsg = "Your request was not sent due to the following error: " & Err.Description

Else

ErrMsg = "Thank You For filling our form<BR>"

ErrMsg = ErrMsg + "If you have any questions please call (781) 270-4800"

End If

End If

%>

<table border="0" cellpadding="0" cellspacing="0" width="0%">

<tr>

<td width="100%" align="center"><hr width="90%">

</td>

</tr>

<tr>

<td align="center"><font face="Arial" size="2"><strong><%=ErrMsg%></strong></font></td>

</tr>

</table>

</body>

</html>

Post #604
Posted 8/2/2007 11:57:01 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 11/10/2008 8:41:49 AM
Posts: 104, Visits: 254
Hello,

Try changing this line:

Mail.Username = "meghan"

to

Mail.Username = meghan@yourdomain.com

Plato
Re-invent Technologies LLC
Re-invent Support Team
http://www.re-invent.com

Specializing in ASP.NET Hosting

Post #605
Posted 8/3/2007 6:29:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/3/2007 6:26:47 AM
Posts: 2, Visits: 7
Yeah, I did that.  No luck.  I fact, I am using a non-adjusted, shorter version from the knowledge base here and it works fine with the log in of just "meghan".  But the moment I add anymore fields (even just one) it breaks.

Any other suggestions?

(Thanks for the idea, though - I was hoping it would work).

Post #606
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Administrator, Re-invent (Paul), Re-invent (Nick)

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 7:03am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 8 queries. Compression Disabled.


Copyright 2007 Re-invent Technologies LLC All Rights Reserved.