Forums

This topic is locked

insert record send email with aspEmail

Posted 15 Jan 2003 02:59:57
1
has voted
15 Jan 2003 02:59:57 Rob Kirkwood posted:
Hi folks,

Have spent the better part of the day trying to find a tutorial on how to send a email with the registration information just entered by a new member. I started off with the login tutorial at udNewbie.com "which is a understatement in my case" but it is designed for Jmail or Cdonts. I only have access to aspMail and aspEmail. Does anyone know of a tutorial on how to make this work with aspEmail or even aspMail.

Here is the code from my page so far and the error message I am getting is error encountered: 550 not local a.com, not a gateway<b></b>

Thanks

&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="../Connections/Phoneababysitter.asp" --&gt;
&lt;%
Dim rsWelcome__strUsername
rsWelcome__strUsername = "xyz"
if (Session("svUsername" &lt;&gt; "" then rsWelcome__strUsername = Session("svUsername"
%&gt;
&lt;%
set rsWelcome = Server.CreateObject("ADODB.Recordset"
rsWelcome.ActiveConnection = MM_Phoneababysitter_STRING
rsWelcome.Source = "SELECT * FROM dbo.tbParents WHERE pUsername = '" + Replace(rsWelcome__strUsername, "'", "''" + "'"
rsWelcome.CursorType = 0
rsWelcome.CursorLocation = 2
rsWelcome.LockType = 3
rsWelcome.Open()
rsWelcome_numRows = 0
%&gt;
&lt;%
Dim strRecipient
strRecipient = rsWelcome.Fields.Item("pEmailAdd".Value
%&gt;
&lt;%
Set Mail = Server.CreateObject("Persits.MailSender"
Mail.Host = "mail.PHONEaBABYSITTER.com" ' Specify a valid SMTP server
Mail.From = " " ' Specify sender's address
Mail.FromName = "postmaster" ' Specify sender's name

Mail.AddAddress strRecipient , ""
Mail.AddAddress " " ' Name is optional
Mail.AddReplyTo ""
Mail.AddAttachment ""

Mail.Subject = "Phone a Babysitter.com, registration confirmation"
Mail.Body = "Welcome" & Chr(13) & Chr(10) & _
"We are glad to have you as a new member. "

On Error Resume Next
Mail.Send
If Err &lt;&gt; 0 Then
Response.Write "Error encountered: " & Err.Description
End If
%&gt;

&lt;html&gt;

Replies

Replied 15 Jan 2003 16:35:43
15 Jan 2003 16:35:43 asp asp replied:
Try changing this line,

Mail.Host = "mail.PHONEaBABYSITTER.com" ' Specify a valid SMTP server



to


Mail.Host = "localhost" ' Specify a valid SMTP server

should do the trick!!

Reply to this topic