%
Function SendMail1(FromName,FromAddress,RemoteHost,Recipient,Subject,BodyText)
Dim Mailer
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.QMessage = false
Mailer.FromName = FromName
Mailer.FromAddress= FromAddress
If RemoteHost="" Then
Mailer.RemoteHost = "mail.buypc.com.my"
Else
Mailer.RemoteHost = RemoteHost
End If
Mailer.AddRecipient "", Recipient
Mailer.Subject = Subject
Mailer.BodyText = BodyText
if Mailer.SendMail then
SendMail = "1"
else
SendMail = "0"
end if
End Function
Sub SendMail(psFromName,psFrom,RemoteHost,psTo,psSubject,psBody)
Dim objMail
Dim iTemp
Err.Clear
'On Error Resume Next
iTemp = False
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
If Err.Number <> 0 Then
Response.Write("
Error:Could not create SMTPsvg.Mailer object
")
Else
objMail.RemoteHost = "localhost"
objMail.FromName = "" & psFrom
objMail.FromAddress = "" & psFrom
objMail.AddRecipient "" & psTo, "" & psTo
objMail.Subject = "" & psSubject
objMail.BodyText = "" & psBody
iTemp = objMail.SendMail
End If
Set objMail = Nothing
End Sub
Function SendMailWithReplyTo(psFromName,psFrom,psReplyTo,RemoteHost,psTo,psSubject,psBody)
Dim objMail
SendMailWithReplyTo = False
Err.Clear
On Error Resume Next
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
If Err.Number <> 0 Then
Response.Write("
Error:Could not create SMTPsvg.Mailer object
")
Else
'objMail.RemoteHost = "localhost"
objMail.RemoteHost = "mail.autoworld.com.my"
objMail.FromName = "" & psFrom
objMail.FromAddress = "" & psFrom
objMail.Replyto = psReplyTo
objMail.AddRecipient "" & psTo, "" & psTo
objMail.Subject = "" & psSubject
objMail.BodyText = "" & psBody
SendMailWithReplyTo = objMail.SendMail
End If
Set objMail = Nothing
End Function
Function SendMailWithReplyToEx(psFromName,psFrom,psReplyTo,RemoteHost,asTO, psSubject,psBody, asCC)
Dim objMail, vCC, vTo, i
SendMailWithReplyToEx = False
Err.Clear
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
If Err.Number <> 0 Then
Response.Write("
Error:Could not create SMTPsvg.Mailer object
")
Else
vCC = split(asCC, ",")
vTo = split(asTo, ",")
'objMail.RemoteHost = "localhost"
objMail.RemoteHost = "mail.autoworld.com.my"
objMail.FromName = "" & psFrom
objMail.FromAddress = "" & psFrom
objMail.Replyto = psReplyTo
for i = 0 to UBound(vTo)
objMail.AddRecipient vTo(i), vTo(i)
Next
for i = 0 to UBound(vCC)
objMail.AddCC vCC(i), vCC(i)
Next
objMail.Subject = "" & psSubject
objMail.BodyText = "" & psBody
SendMailWithReplyToEx = objMail.SendMail
End If
Set objMail = Nothing
End Function
Function SendMailReplyToSender(psFromName,psFrom,psReplyTo,RemoteHost,psTo,psSubject,psBody)
Dim objMail
SendMailReplyToSender = False
Err.Clear
On Error Resume Next
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
If Err.Number <> 0 Then
Response.Write("
Error:Could not create SMTPsvg.Mailer object
")
Else
'objMail.RemoteHost = "localhost"
objMail.RemoteHost = "mail.autoworld.com.my"
objMail.FromName = "" & psFromName
objMail.FromAddress = "" & psFrom
objMail.Replyto = psReplyTo
objMail.AddRecipient "" & psTo, "" & psTo
objMail.Subject = "" & psSubject
objMail.BodyText = "" & psBody
SendMailWithReplyTo = objMail.SendMail
End If
Set objMail = Nothing
End Function
Function DumpEmail(aobjCmd, asGroup, asSender,asRxOrgCode, asRxBranchCode, asRxUserId, asBody, asCatId, asListingId)
Dim nRA
nRA = 0
while aobjCmd.Parameters.Count > 0
aobjCmd.Parameters.Delete 0
wend
aobjCmd.CommandText = "INSERT INTO awMailDump (awGroup, awSender, awRxOrgCode, awRxBranchCode, awRxUserId, awContent, awCatId, awListingId) values(?,?,?,?,?,?,?,?)"
aobjCmd.CommandType = 1
aobjCmd.Execute nRA, Array(asGroup, asSender,asRxOrgCode, asRxBranchCode, asRxUserId, asBody, asCatId, asListingId)
DumpEmail = nRA
End Function
%>