1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
<%
' SETTINGS
' Type the distribution list managing address:
emailmanager = "mail@yahoo.fr"
' Type the positive and negative reply pages URLs
' (if the pages are placed in the same directory you can omit the full path
' and just enter the file name, otherwise enter the full URL):
urlok = "formok.htm"
urlko = "formko.htm"
' If the server is not setup for e-mail sending, enable the SpecifySMTP
' (set the value 1) and specify the SMTP server name to be used (ask your provider)
SpecifySMTP = 0
ServerSMTP = "localhost"
' END SETTINGS
msg = ""
For Each k in Request.Form
If Lcase(k) <> "submit" Then
msg = msg & k & ":" & Request.Form(k) & chr(13) & chr(10)
End If
next
email = Request.Form("email")
Set rex = New RegExp
With rex
.Pattern = "^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
.IgnoreCase = True
.Global = True
End With
Ok = rex.Test(email)
If Ok And (msg <>"") Then
if SpecifySMTP = 0 Then ServerSMTP = ""
Mail emailmanager,"Message internaute",msg,email, ServerSMTP
Response.Redirect urlok
Else
Response.Redirect urlko
End If
Function Mail(strTo, strSubject, strBody, strFrom, strSMTP)
set iMsg = CreateObject("CDO.Message")
If strSMTP <> "" Then
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTP
Flds.Update
End If
With iMsg
If strSMTP <> "" Then
Set .Configuration = iConf
End If
.TextBody = strBody
.To = strTo
.From = strFrom
.Subject = strSubject
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function
%> |
Partager