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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto reply - ASP with SMTP 1

Status
Not open for further replies.

Mike12tet

Technical User
Dec 15, 2003
24
0
0
NZ
I'm trying to create simple form to send Thank you email to customer after filling the form.
I'm testing it on simple form (see below), when I use actual email addresses (my email) in TO: and FROM:; I will receive "Simple CDO message" email, but if I use the code below (geting the email address (FROM:) from form - emailAddress field) after submit the page is redirected to thankyou.asp but no email is send to me.


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%
Dim strEmail

strEmail = Trim(Request.Form("emailAddress"))

If (strEmail <> "" ) Then
theSchema = "
Set cdoConfig = server.CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(theSchema & "sendusing") = 2 ' cdoSendUsingPort
.Item(theSchema & "smtpserver") = "tfpmail1.domain.com"
.Item(theSchema & "smtpserverport") = 25
.Item(theSchema & "smtpconnectiontimeout") = 60
.update
End With

Set cdoMessage = server.CreateObject("CDO.Message")

with cdoMessage
Set.Configuration = cdoConfig
.From = strEmail
.To = "myemail@domain.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With
End If
Set cdoMessage = Nothing
Set cdoConfig = Nothing

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>email</title>
</head>

<body>


<form method="post" id=form1 name=form1 action="thankyou.asp" >
<b>Enter your email address:</b><br>
<input name="emailAddress" type="text" id="emailAddress" value="<%=Request.Form("emailAddress")%>" />
<p>
<input type="submit" name="Submit" value="Submit" id="Submit"/>
</form>


</body>
</html>


What am I missing?? any help would be appreciated.

Michal
 
Some email servers will not accept a new message if the "FROM" does not contain a valid account on that server... for anti-spam reasons.
 
Sheco,

Can we make the changes on our email server to accept these email addresses ("FROM" and "TO")? Or what are my other options to get around this issue?

Thanks,

Michal
 
Check out this wikipedia article:
It explains mail relays better than I could and maybe it will give you enough info to determine if the problem in your first post is not actually a problem in the code but rather an issue with the behavior of your mail server.
 
Actually I just took another look at that article it has a bunch of superflous history but probably enough to put you on the right track.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top