Hello
How do I send an email without any third party and no outlook installed on the machine just using
pb functions for define email address to , send from, file attach and so on ?
thanks
Hello
How do I send an email without any third party and no outlook installed on the machine just using
pb functions for define email address to , send from, file attach and so on ?
thanks
Totally over my head here. I've never worked with non visuals objects.
I inserted the user objects on a window in my app through the insert/Object/UserObject menu but am at a loss as to what to try next. Also, what type of variable is gn_smtp?
I moved the files into my main app but I cannot regenerate the u_tabpg_smtp object as it gives me the following error message:
---------- Compiler: Errors (8:39:27 AM)
emailsmtp_126.pbl(u_tabpg_smtp).cb_send.clicked.45: Error C0015: Undefined variable: gn_smtp
Roland,
I've downloaded your PB emailsmtp64.pbl and placed it in my workspace. When I set it as the current target, works great. My question is, for us newbies, how do I incorporate it into an existing PB app?
Hi Moshe,
you can use the new C# Web API. I presented this solution at Elevate 2019, the PB client can call the Web API using HttpClient/RESTclient objects.
The presentation is called "PowerServer and C# Web API integration: Why, When, How" and the example based on SMTP for sending emails is at minute 28'15", slide 27.
You can watch it from "My Elevate" in your Appeon User Center, or from here.
Best,
.m
Does your PowerBuilder application connect to MS SQL Server? If so, you could use SQL's sp_send_dbmail stored procedure.
Agree with Roland,
PB app is not a mail server supporting standard mail protocols. Instead, lightweight send-mail can be done using SMTP access to an existing mail server. Roland's code examples are excellent source for code and for inspiration.
HTH /Michael
You'll need to use SMTP which is a protocol to communicate directly with a mail server.
I have two different examples:
https://www.topwizprogramming.com/freecode_emailsmtp.html
https://www.topwizprogramming.com/pbnismtp.html
n_smtp64 gn_smtp
I personally don't add non visuals like you did. Instead add it as an instance variable in the window:
n_smtp64 in_smtp
And then in your code refer to it like this:
in_smtp.of_SetSubject("The subject of the email")
Some people like to name non-visual variables with nv like this:
n_smtp64 inv_smtp
It is totally up to you, I use both naming styles.
Local variables which are defined in an event or function should start with an l (small L).
Examples:
Boolean lb_switch
Integer li_index
Long ll_count
String ls_title