views:

51

answers:

0

i have written coding of mail..and its successfully delivers but if i have attached a file then it's not working.

Coding..

strHost = "mysmtphostname"

   Set Mail = Server.CreateObject("Persits.MailSender")
   ' enter valid SMTP host
   Mail.Host = strHost
   Mail.Username = uname
   Mail.Password = password
   Mail.IsHTML = True
   Mail.From = "sender"
   Mail.AddAddress "[email protected]"
   Mail.AddAttachment Server.MapPath("product/IPO_Secret.pdf")
   ' message subject
   Mail.Subject ="Hi"
   Mail.Body ="Thank you for your payment"
   strErr = ""
   bSuccess = False
   On Error Resume Next
   Mail.Send ' send message
   If Err <> 0 Then ' error occurred
      strErr = Err.Description
   else
      bSuccess = True
   End If