Il semble un peu étrange que d'un serveur Windows vous aurait le faire en Perl. Je fais le mien avec ASP à l'aide de Visual Basic. Heres un simple avec les commentaires qui possitively œuvres, quel que soit son stockées dans le répertoire (suppose que votre serveur supporte ASP et depuis son serveur Windows a, il faudrait que je le crois - (permissions du répertoire doivent être établis pour lire et exécuter des scripts - CGI -bin est probablement déjà cette façon de sorte que son aussi bon un endroit pour laisser tomber comme un autre.) (save dans un fichier. asp):
<%
SenderEmail = request.form ("email")
SenderName = request.form ("name")
Set JMail = Server.CreateObject("JMail.SMTPMail")
' This is my local SMTP server
JMail.ServerAddress = "mailhub.yoursmptserver.com"
' This is me....
JMail.SenderName = SenderName
JMail.Sender = SenderEmail
JMail.Subject = "Subscription Submission"
' Get the recipients mailbox from a form (note the lack of a equal sign).
JMail.AddRecipient "yourmail@wherever.com"
'JMail.AddRecipient "dad@some.com"
' The body property is bodth read and write.
' If you want to append text to the body you can
' use JMail.Body = JMail.Body & "Hello world!"
' or you can use JMail.AppendText "Hello World!"
' which in many cases is easier to use.
JMail.Body ="Name = " & request.form ("name") & vbCrLf&_
"Email Address = " & request.form ("email")
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
' Must make sure that IUSR_???? has access to the following files.
'JMail.AppendBodyFromFile "e:\mail\standard_footer.txt"
'JMail.AddAttachment "e:\products\MyProduct.exe"
' Send it...
JMail.Execute
Set JMail = nothing
%>
- <%
- SenderEmail = request.form ("email")
- SenderName = request.form ("name")
- Set JMail = Server.CreateObject("JMail.SMTPMail")
- ' This is my local SMTP server
- JMail.ServerAddress = "mailhub.yoursmptserver.com"
- ' This is me....
- JMail.SenderName = SenderName
- JMail.Sender = SenderEmail
- JMail.Subject = "Subscription Submission"
- ' Get the recipients mailbox from a form (note the lack of a equal sign).
- JMail.AddRecipient "yourmail@wherever.com"
- 'JMail.AddRecipient "dad@some.com"
- ' The body property is bodth read and write.
- ' If you want to append text to the body you can
- ' use JMail.Body = JMail.Body & "Hello world!"
- ' or you can use JMail.AppendText "Hello World!"
- ' which in many cases is easier to use.
- JMail.Body ="Name = " & request.form ("name") & vbCrLf&_
- "Email Address = " & request.form ("email")
- JMail.Priority = 3
- JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
- ' Must make sure that IUSR_???? has access to the following files.
- 'JMail.AppendBodyFromFile "e:\mail\standard_footer.txt"
- 'JMail.AddAttachment "e:\products\MyProduct.exe"
- ' Send it...
- JMail.Execute
- Set JMail = nothing
- %>
Le formulaire html est tout aussi fondamental (Enregistrer en tant que page HTML):
<FORM method="POST" action="/cgi-bin/subscribeform.asp">
<input type="hidden" name="required" value="Name,SubscriberMail" />
Your Name:
<input tabindex="1" type="text" size="30" name="name" /><br />
Your Email:
<input tabindex="2" type="text" size="30" name="email" /><br />
<input tabindex="3" type="submit" value="Submit" title="Submit this form"><br />
</form>
- <FORM method="POST" action="/cgi-bin/subscribeform.asp">
- <input type="hidden" name="required" value="Name,SubscriberMail" />
- Your Name:
- <input tabindex="1" type="text" size="30" name="name" /><br />
- Your Email:
- <input tabindex="2" type="text" size="30" name="email" /><br />
- <input tabindex="3" type="submit" value="Submit" title="Submit this form"><br />
- </form>
C'est un modèle de travail. Il suffit de changer la Jmail.AddRecipient à votre adresse email et changer la Jmail.ServerAddress à vos hôtes SMTP du serveur et cela devrait fonctionner pour vous la première fois, pourvu que vous pouvez utiliser ASP
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.