I have hit a wall, i am told by my hoster i need to use smtpsvg to send emails from web sites. cool i used teh following code but am unable to send emails what am i doing wrong here help!! new to this game...
PAGE CODE
<form action="<%=Request.ServerVariables("PATH_INFO"
%>" method="post">
<p>
<input name="_recipients" type="hidden" value="info@identityrecordings.co.uk" />
<input name="_subject" type="hidden" value="Comments" />
<input name="_requiredFields" type="hidden" value="Name,Comments,Email" />
<input name="_requiredFields" type="hidden" value="Name,Mobile,Email,Comments" />
<table cellspacing="0" cellpadding="3" border="0" align="center">
<tr>
<td align="right" class="btext">Name: </td>
<td align="left"><input name="Name" type="text" /></td>
</tr>
<tr>
<td align="right" class="btext">Mobile Number: </td>
<td align="left"><input name="Mobile" type="text" /></td>
</tr>
<tr>
<td align="right" class="btext">Email Address: </td>
<td align="left"><input name="Email" type="text" /></td>
</tr>
<tr>
<td align="center" colspan="2" class="btext">Comments:</td>
</tr>
<tr>
<td align="center" colspan="2"><textarea name="Comments" rows=5 cols=50></textarea></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="Submit" />
<input type="hidden" name="sendEmail" value="1">
<input type="reset" value="Clear" /></td>
</tr>
</table>
</p>
<%
if Request.Form("sendEmail"
> "" then
if Request.Form("Name"
> "" then
if Request.Form("Mobile"
> "" then
if Request.Form("Email"
> "" then
if Request.Form("Comments"
> "" then
strComments = replace(Request.Form("Comments"
,vbcrlf,"<BR>"
else
strComments = "No comments given."
end if
lngSent = SendEmail("Comments",strComments,Request.Form("Email"
,Application("WEBSITE_EMAIL"
,""
strMessage = "Thank you.\n\nYour comments have been received."
else
strMessage = "Please enter your email address before trying to send us a comment."
end if
end if
end if
end if
if strMessage > "" then
%>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
alert('<%=strMessage%>')
//-->
</SCRIPT>
<%end if%>
<p align="center" class="news">We
promise that we will not give your details to anyone else and will only send
you information regarding our events. If you want to unsubscribe, please send
an email with 'UNSUBSCRIBE' in the subject to <a href="mailto:info@identityrecordings.co.uk">
info@identityrecordings.co.uk</a>.</p>
</form>
GENERATE EMAIL CODE TO SEND EMAIL
if Application("SMTPSVG"
then
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.ContentType = "text/html"
Mailer.RemoteHost = Application("SMTP_SERVER_NAME"
if strEmailsTo > "" then
arrEmailsTo = split(strEmailsTo,","
for lngEmailsTo = 0 to ubound(arrEmailsTo)
Mailer.AddRecipient "", arrEmailsTo(lngEmailsTo)
next
else
Mailer.AddRecipient "", Application("WEBSITE_EMAIL"
end if
if strEmailsBCC > "" then
arrEmailsBCC = split(strEmailsBCC,","
for lngEmailsBCC = 0 to ubound(arrEmailsBCC)
Mailer.AddBCC trim(arrEmailsBCC(lngEmailsBCC))
next
end if
if strEmailFrom > "" then
Mailer.FromAddress = strEmailFrom
else
Mailer.FromAddress = Application("WEBSITE_EMAIL"
end if
Mailer.Subject = strSubject
Mailer.BodyText = strHTML
Mailer.SendMail
Set Mailer = Nothing
end if
PAGE CODE
<form action="<%=Request.ServerVariables("PATH_INFO"
<p>
<input name="_recipients" type="hidden" value="info@identityrecordings.co.uk" />
<input name="_subject" type="hidden" value="Comments" />
<input name="_requiredFields" type="hidden" value="Name,Comments,Email" />
<input name="_requiredFields" type="hidden" value="Name,Mobile,Email,Comments" />
<table cellspacing="0" cellpadding="3" border="0" align="center">
<tr>
<td align="right" class="btext">Name: </td>
<td align="left"><input name="Name" type="text" /></td>
</tr>
<tr>
<td align="right" class="btext">Mobile Number: </td>
<td align="left"><input name="Mobile" type="text" /></td>
</tr>
<tr>
<td align="right" class="btext">Email Address: </td>
<td align="left"><input name="Email" type="text" /></td>
</tr>
<tr>
<td align="center" colspan="2" class="btext">Comments:</td>
</tr>
<tr>
<td align="center" colspan="2"><textarea name="Comments" rows=5 cols=50></textarea></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="Submit" />
<input type="hidden" name="sendEmail" value="1">
<input type="reset" value="Clear" /></td>
</tr>
</table>
</p>
<%
if Request.Form("sendEmail"
if Request.Form("Name"
if Request.Form("Mobile"
if Request.Form("Email"
if Request.Form("Comments"
strComments = replace(Request.Form("Comments"
else
strComments = "No comments given."
end if
lngSent = SendEmail("Comments",strComments,Request.Form("Email"
strMessage = "Thank you.\n\nYour comments have been received."
else
strMessage = "Please enter your email address before trying to send us a comment."
end if
end if
end if
end if
if strMessage > "" then
%>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
alert('<%=strMessage%>')
//-->
</SCRIPT>
<%end if%>
<p align="center" class="news">We
promise that we will not give your details to anyone else and will only send
you information regarding our events. If you want to unsubscribe, please send
an email with 'UNSUBSCRIBE' in the subject to <a href="mailto:info@identityrecordings.co.uk">
info@identityrecordings.co.uk</a>.</p>
</form>
GENERATE EMAIL CODE TO SEND EMAIL
if Application("SMTPSVG"
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.ContentType = "text/html"
Mailer.RemoteHost = Application("SMTP_SERVER_NAME"
if strEmailsTo > "" then
arrEmailsTo = split(strEmailsTo,","
for lngEmailsTo = 0 to ubound(arrEmailsTo)
Mailer.AddRecipient "", arrEmailsTo(lngEmailsTo)
next
else
Mailer.AddRecipient "", Application("WEBSITE_EMAIL"
end if
if strEmailsBCC > "" then
arrEmailsBCC = split(strEmailsBCC,","
for lngEmailsBCC = 0 to ubound(arrEmailsBCC)
Mailer.AddBCC trim(arrEmailsBCC(lngEmailsBCC))
next
end if
if strEmailFrom > "" then
Mailer.FromAddress = strEmailFrom
else
Mailer.FromAddress = Application("WEBSITE_EMAIL"
end if
Mailer.Subject = strSubject
Mailer.BodyText = strHTML
Mailer.SendMail
Set Mailer = Nothing
end if