Form handler JMail (kan ik sende til hotmail email mv.)
Jeg bruger nedestående formhandler til at sende emails til mig automatisk. Problemet ligger i den kun vil sende til de emails som er knyttet til min udbyder Cliche.dk. (F.eks vil den ik sende til xxxxx@hotmail.com men derimod gerne xxxxx@xn--staldhj-v1a.dk da xn--staldhj-v1a.dk ligger hos Cliche.dk) Svært at forklare. :-/Jeg tænker det har nået at gøre med JMail komponenten der ligger på Cliche som det kører igennem... Eller også er det bare min kode der er forkert?
Jeg savner en hurtig løsning, eller et alternativ (anden formhandler, men som også er meget let at arbejde med som i nedestående).
Håber nogen kan hjælpe! Tak på forhånd! :-)
-------------------------FORM HANDLER-------------------
<%
strForm = strForm & "<b>Til- og framelding til jagt.</b><br><br>"
strForm = strForm & "<table border='1'>"
strForm = strForm & "<tr><td width='75'><b>Dato</b></td><td width='105'><b>Tilmelding</b></td><td width='105'><b>Framelding</b></td><td width='105'><b>Gæster</b></td>"
strForm = strForm & "<tr><td width='75'>08.10.05</td><td width='105'>" & Request.Form("tilmelding1") & "</td><td width='105'>" & Request.Form("framelding1") & "</td><td width='105'>" & Request.Form("gaester1") & "</td></tr>" & vbCRLF
strForm = strForm & "<tr><td width='75'>29.10.05</td><td width='105'>" & Request.Form("tilmelding2") & "</td><td width='105'>" & Request.Form("framelding2") & "</td><td width='105'>" & Request.Form("gaester2") & "</td></tr>" & vbCRLF
strForm = strForm & "<tr><td width='75'>19.11.05</td><td width='105'>" & Request.Form("tilmelding3") & "</td><td width='105'>" & Request.Form("framelding3") & "</td><td width='105'>" & Request.Form("gaester3") & "</td></tr>" & vbCRLF
strForm = strForm & "<tr><td width='75'>10.12.05</td><td width='105'>" & Request.Form("tilmelding4") & "</td><td width='105'>" & Request.Form("framelding4") & "</td><td width='105'>" & Request.Form("gaester4") & "</td></tr>" & vbCRLF
strForm = strForm & "</table>"
' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )
' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true
' Most mailservers require a valid email address
' for the sender
msg.From = "mailbot@xn--staldhj-v1a.dk"
msg.FromName = "Mailbot"
' Next we have to add some recipients.
' The addRecipients method can be used multiple times.
' Also note how we skip the name the second time, it
' is as you see optional to provide a name.
msg.AddRecipient "heaton81@hotmail.com"
' The subject of the message
msg.Subject = "Jagttider - Booking!"
' The body property is both 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.
'
' Note the use of vbCrLf to add linebreaks to our email
msg.HTMLBody = strForm
' There.. we have now succesfully created our message.
' Now we can either send the message or save it
' as a draft in a Database.
' To save the message you would typicly use the
' Message objects Text property
' to do something like this:
'
' SaveMessageDraft( msg.Text )
' Note that this function call is only an
' example. The function does not exist by
' default, you have to create it yourself.
' To send the message, you use the Send()
' method, which takes one parameter that
' should be your mailservers address
'
' To capture any errors which might occur,
' we wrap the call in an IF statement
if not msg.Send("mail.cliche.dk" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.Redirect("form_sent.asp")
end if
' And we're done! the message has been sent.
%>
-------------------------/ FORM HANDLER-------------------
