Hi Im writing a function but it dosnt seem to fetch the parameters I send it. Could anybody have a look at this please?
Code:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set JMail = Server.CreateObject("JMail.SMTPMail")
Jmail.serveraddress = "[REMOVED]"
DIM strFunction
function send_mail( cmd, typeMail, mailTo, mailFrom, userID, userUID, userName, caseProduct, caseID, mailTitel, mailBody, notifyLine )
if fs.FileExists(Server.MapPath("../[REMOVED]/" & typeMail & ".asp")) then
Set f = fs.OpenTextFile(Server.MapPath("../[REMOVED]/" & typeMail & ".asp"), 1)
mailBody = f.ReadAll
f.Close
mailBody = Replace(mailBody, "[GAR:TRADEPRODUCT]", caseProduct)
mailBody = Replace(mailBody, "[GAR:TRADETO]", mailTo)
mailBody = Replace(mailBody, "[GAR:TRADEFROM]", userName)
mailBody = Replace(mailBody, "[GAR:TRADEID]", caseID)
mailBody = Replace(mailBody, "[GAR:NOTIFYLINE]", notifyLine)
JMail.Sender = mailFrom
JMail.SenderName = "[REMOVED]"
JMail.Subject = mailTitel
JMail.Body = mailBody
JMail.Priority = 3
JMail.AddRecipient mailTo
if JMail.Execute then
send_mail = 1
else
send_mail = 0
end if
JMail.ClearRecipients
else
send_mail = 0
end if
end function
strFunction = send_mail("first","sendfirstmail","[REMOVED]","[REMOVED]","1","1000","Frederik","Mobil","32","Tillykke","HEj ven","hej igen") '(Dummi data)
if strFunction = 1 then
Response.Write "done"
else
'Debug
Response.Write cmd & typeMYMail & mailFrom & userID
Response.Write Server.MapPath("/[REMOVED]/" & typeMail & ".asp")
end if
%>