Hi friends,
I am trying to develop an application in PB6.5 which will send email through SMTP,without using any 3rd party application like,EasyMail.
Is it possible to write a powerscript which will send email automatically through SMTP?
I have tried the code mentioned below, but it is always giving some errors:
The Code:
OLEObject mailman
OLEObject eMail
mailman = Create OLEObject
eMail = Create OLEObject
li_return = mailman.ConnectToNewObject("ChilkatMail2.ChilkatMailMan2.1")
If li_return <> 0 Then
Destroy mailman
Return 98
End if
li_return = eMail.ConnectToNewObject("ChilkatMail2.ChilkatEMail2.1")
If li_return <> 0 Then
Destroy eMail
Return 97
End if
mailman.UnlockComponent("unlock-code")
mailman.SmtpHost = "smtp.mail.com"
mailman.SmtpPort = 25
eMail.AddTo("Support", "support@chilkatsoft.com")
eMail.Subject = "This is the email subject"
eMail.Body = "This is the email body."
eMail.From = "joe.programmer@somewhere.com"
mailman.SendEmail(eMail)
Errors:
the ConnectToNewObject function always throwing error
Plz help me out...........
I am trying to develop an application in PB6.5 which will send email through SMTP,without using any 3rd party application like,EasyMail.
Is it possible to write a powerscript which will send email automatically through SMTP?
I have tried the code mentioned below, but it is always giving some errors:
The Code:
OLEObject mailman
OLEObject eMail
mailman = Create OLEObject
eMail = Create OLEObject
li_return = mailman.ConnectToNewObject("ChilkatMail2.ChilkatMailMan2.1")
If li_return <> 0 Then
Destroy mailman
Return 98
End if
li_return = eMail.ConnectToNewObject("ChilkatMail2.ChilkatEMail2.1")
If li_return <> 0 Then
Destroy eMail
Return 97
End if
mailman.UnlockComponent("unlock-code")
mailman.SmtpHost = "smtp.mail.com"
mailman.SmtpPort = 25
eMail.AddTo("Support", "support@chilkatsoft.com")
eMail.Subject = "This is the email subject"
eMail.Body = "This is the email body."
eMail.From = "joe.programmer@somewhere.com"
mailman.SendEmail(eMail)
Errors:
the ConnectToNewObject function always throwing error
Plz help me out...........