PowerBuilder Support

Accelerate development with PowerBuilder, the market’s favorite 4GL RAD tool.

Hello,

Send SMTP email using Power Builder 7? When i tried to debug the application using below code i found some issue in Line 3.
Pl assist.

Line 1. OLEObject smtp;
Line 2. smtp = CREATE OLEObject
Line 3. smtp.RemoteHost = "smtp.spectec.net" //*** Problem here ***//
Line 4. smtp.CustomCharSet = "8bit"
Line 5. smtp.ContentType = "text/html"

Share

Reply to This

Replies to This Discussion

There is no ConnectToNewObject. You have to link to the SMTP-OCX ( what ever you want to use ) to work with it.

Benjamin

Reply to This

thanks, I try to test with chilkat Mail component but problems occurs at mailman.UnlockComponent("unlock-code").

1. Put the ChilkatMail.dll file in root folder.

2. 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") //*** Error Msg comes out = "Name not found calling external object function unlockcomponent." ***//

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)

Reply to This

That same code works for me, adjusted for my SMTP server of course. Have you tried contacting support at Chilkat? I found them very helpful.

Reply to This

Did you register the dll with "regsvr32 C:\pathtodll\ChilkatMail.dll" ?

Reply to This

I would have guessed that the ConnectToNewObject() call would have failed if the DLL wasn't registered. It's always a good thing to check, though!

Reply to This

Thanks everybody,

I just came back to Power Builder activities.

Actually, I have put wrong parameter in below line.

li_return = mailman.ConnectToNewObject("ChilkatMail2.ChilkatMailMan2.1")

Reply to This

RSS

© 2009   Created by Jason Fenter on Ning.   Create a Ning Network!

Badges  |  Report an Issue  |  Privacy  |  Terms of Service