JMail - hente alle data fra form
Jeg slogs lidt med JMail - med noget hjælp er jeg kommet så langt.Nu mangler jeg at få alle informationen med i mailen.
Det er endnu ikke lykkedes mig at få name med og ved at sætte JMail.Adress = adress og sætte adress = Request.Form("name")går det det i helt i hårdknude!
:-) karsten_larsen
her er min kode:
<%
if request.form("form") = "send" then
name = Request.Form("name")
senderEmail = Request.Form("email")
subject = Request.Form("subject")
recipient = "sendes til min email adresse"
body = Request.Form("body")
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.Logging = true
JMail.silent = true
JMail.ServerAddress = "mail.mit domæne"
JMail.Sender = senderEmail
JMail.Subject = subject
JMail.AddRecipient recipient
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Body = body
JMail.Execute
Set JMail = Nothing
response.write "Det lykkes endeligt"
else
%>
<html>
<head>
<title>emailform</title>
</head>
<body onLoad="window.form.name.focus();">
<form method="post" action="sendmail.asp" name="form">
Complete this form and click the submit-button. We will answer your
questions as soon as possible.
<br><br>
Your name<br>
<input type="text" size="25" name="name"><br>
Your Adress<br>
<input type="text" size="25" name="adress"><br>
Your email<br>
<input type="text" size="25" name="email"><br>
<select name="subject" size="1">
<option value="help">help
<option value="tips">tips
<option value="other">other
</select>
<br> Enter your question<br>
<textarea name="body" cols="40" rows="15" wrap="PHYSICAL"></textarea>
<br>
<input type="submit" name="form" value="send">
<%end if %>
</form>
</body>
</html>
