my code is as follows
if lsIsMail = "YES" then
AppTo = request.Form("txtAppTo")
AppCC = request.Form("txtAppCC")
AppSubject = request.Form("txtAppSubject")
AppText = request.Form("txtAppText")
AppText = AppText & "<br><br><a href=""" & Application("ApplURL") & "/Add-sample.asp?SID=" & lsSampleID & "&TaskID=" & lsTaskID & """>Click here to view page</a>"
SendTo = request.Form("txtSendTo")
SendCC = request.Form("txtSendCC")
SendSubject = request.Form("txtSendSubject")
SendText = request.Form("txtSendText")
SendText = SendText + "<br><br><a href=""" & Application("ApplURL") & "/Add-sample.asp?SID=" & lsSampleID & "&TaskID=" & lsTaskID & """>Click here to view page</a>"
EnableMail = session("EnableMail")
if EnableMail then
if AppTo <> "" then
RecipientName = AppTo
RecipientAddress = AppTo
sendBCC = request.Form("txtAppBCC")
attachfname = request.Form("txtAttach1")
else
RecipientName = SendTo
RecipientAddress = SendTo
sendBCC = request.Form("txtSendBCC")
attachfname = request.Form("txtAttach2")
end if
if AppTo <> ""
GoMail =
sendMessage (RecipientName,RecipientAddress,AppCC,sendBCC,AppS ubject, replace(AppText,chr(13),"<br>"),attachfname)
Function sendMessage(MailToName,mailTo,MailCC,MailBCC,mailS ubject,mailBody,attachFname)
Set mailer = Server.CreateObject("SMTPsvg.Mailer")
mailer.FromName = "WebMaster of Biodar"
mailer.FromAddress = "
[email protected]"
mailer.RemoteHost = "199.200.213.1:50"
mailer.AddRecipient MailToName, mailTo
mailer.AddCC MailCC,MailCC
mailer.AddBCC MailBCC,MailBCC
mailer.Subject = mailSubject
mailer.ReplyTo = MailBCC
mailer.BodyText = mailBody
mailer.AddAttachment (attachFname)
mailer.ContentType = "text/html"
Mailer.Priority = 3 ' 1 = High, 3 = Normal, 5 = Low
If mailer.Sendmail then ' Send message
sendMessage = True ' Email was sent ok, return True
else ' Send Failure
sendMessage = mailer.Response ' Return error message
end if
end function