Hejsa alle,
Jeg sidder og kæmper med at få denne "tip en ven" formular til at
virke.
Når jeg sætter en almindelig email ind i Mailer.AddRecipient så
sender den fint, men når den selv skal indsætte email fra
formularen(toEmail) sender den ikke?
Håber i kan hjælpe mig!
Mvh
Michael
Mine to sider ser sådan her ud:
Side 1
<%
page=Request.ServerVariables("HTTP_REFERER")
%>
<table border=0 cellpadding=5 cellspacing=5 width=95% >
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="2"
bgcolor="#99ccff">
<tr>
<td><font face="verdana, arial"
size="2"> <b>Tell a Friend</b></font></td>
</tr>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=0 width=100%
bgcolor="#ffffff">
<tr>
<td valign="top">
<font face="verdana, arial" size="1">
Use the form below to send your
friend an e-mail telling them about this page
(we <b>do not</b> store
the email addresses and will <B>never</b>
contact you using email addresses entered only in tell-a-friend)
</font></td>
</tr>
<TR>
<td>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align="left">
<form action="tell_a_friend_script.asp" method="POST">
<font face="verdana, arial" size="2">
<nobr>Your e-mail: </nobr>
</font></td>
<td align="left">
<input type="Text" name="fromEmail"
value="" size="32" maxlength="255">
</TD>
</tr>
<tr>
<td align="left">
<font face="verdana, arial" size="2">
<nobr>Your friend's e-mail: </nobr>
</font></td>
<td align="left">
<input type="Text" name="toEmail"
value="" size="32" maxlength="255">
</td>
</tr>
<tr>
<td align="left" valign=top>
<font face="verdana, arial" size="2">
<nobr>Additional Message: </nobr>
</font></td>
<td align="left">
<textarea name=message maxlength=500
cols=24 rows=5></textarea>
</td>
</tr>
<TR><td height="5" colspan="2"></td></tr>
<TR>
<td></td>
<td align="left" valign="top">
<input type="hidden" name="page" value="<%=page%>">
<input type="Submit" value="Send It"></td></tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Side 2
<%
fromEmail=Request.Form("fromEmail")
toEmail=Request.Form("toEmail")
message=Request.Form("message")
page=Request.Form("page")
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Tester"
Mailer.FromAddress= "test@gadzilla.dk"
Mailer.RemoteHost = "smtp.123hotel.dk"
Mailer.AddRecipient toEmail
Mailer.Subject = "Gadzilla.dk website!"
Mailer.BodyText = message & VbCrLf & VbCrLf & page
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials