hjælp til jmail mail
Jeg prøver at sende en htmlmail via jmail, men jeg kan ikke få det til at virke. I øjeblikket sender den ingenting, men den udskriver hellere ingen fejlmeldinger...?<% option explicit %>
<%
Dim formNavn, formMor, formFar, formTil, formEmail, path, JMail, text
'--- Hent felter fra form
'formNavn = Request.Form("navn")
'formMor = Request.Form("mor")
'formFar = Request.Form("far")
'formEmail = Request.Form("email")
path = "http://xx.xx.x.xxx/mail/"
'modtagernavn(e)
if not isEmpty(formMor) and not isEmpty(formFar) then
formTil = formMor & " og " & formFar
else if isEmpty(formMor) then
formTil = formFar
else
formTil = formMor
end if
'--- Opbygger og sender mail til brugeren
set Jmail=Nothing
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.Silent = true
JMail.Logging = False 'true
JMail.Priority = 3
'local smtp server
JMail.ServerAddress=Application("SMTPServer")
'Sender
JMail.Sender=formNavn
'Subject
JMail.Subject = "mail emne"
'add recipients
JMail.AddRecipient formEmail
text = ""
text = text & "<html>"
text = text & "<head>"
text = text & "<title>TEST</title>"
text = text & "<style type='text/css' media='all'>"
text = text & "html, body{padding:0; margin:0; border:0; background-color:#6FB31A;}"
text = text & "p{font-family:verdana,arial; font-size:12px; color:#000;}"
text = text & "</style>"
text = text & "</head>"
text = text & "<body text=#000000 bgColor=#6FB31A>"
text = text & "<center>"
text = text & "<p>Klik her hvis du ikke kan læse mailen: <a href='" & path & "mail.asp?fra=" & formNavn & "&til=" & formTil & "&email=" & formEmail & "' target='_blank'>" & path & "mail.asp?fra=" & formNavn & "&til=" & formTil & "&email=" & formEmail & "</a></p>"
text = text & "</center>"
text = text & "<table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%'>"
text = text & "<tr>"
text = text & "<td align='center' valign='middle'>"
text = text & "<table width=570 height=444 cellSpacing=0 cellPadding=0 border=0>"
text = text & "<tr valign='top'>"
text = text & "<td rowspan='2' width='306' height='315' background='" & path & "mail1.gif'><p style='padding:270px 0 0 25px;'>" & formNavn & "</p></td>"
text = text & "<td width='264' height='94' background='" & path & "mail2.gif'><p style='padding:35px 0 0 15px;'>" & formTil & "</p></td>"
text = text & "</tr>"
text = text & "<tr valign='top'>"
text = text & "<td width='264' height='221' background='" & path & "mail3.gif'><p style='padding:20px 0 0 15px;'>" & formEmail & "</p></td>"
text = text & "</tr>"
text = text & "<tr>"
text = text & "<td colspan='2' width='570' height='129' background='" & path & "mail4.gif'> </td>"
text = text & "</tr>"
text = text & "</table>"
text = text & "</td>"
text = text & "</tr>"
text = text & "</table>"
text = text & "</body>"
text = text & "</html>"
'Body
JMail.Body = text
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
IF NOT JMail.execute THEN
Response.Write( "ERROR MESSAGE: " & JMail.ErrorMessage & "<BR>" & vbcrlf )
Response.Write( "ERROR SOURCE: " & JMail.ErrorSource & "<BR>" & vbcrlf )
Response.Write( "LOG: <pre>" & JMail.Log & "</pre>" & vbcrlf & "</font>")
ELSE
Response.redirect("tip_response.asp")
end if
set Jmail=nothing
%>
