T TonySav Member Jul 11, 2016 #1 I want to include in my B4J project the ability to generate and send an email. I would prefer to use the PC's existing email set-up. Can anyone assist me with an API to achieve this? A further enhancement would be the ability to access the systems Address Book.
I want to include in my B4J project the ability to generate and send an email. I would prefer to use the PC's existing email set-up. Can anyone assist me with an API to achieve this? A further enhancement would be the ability to access the systems Address Book.
Erel B4X founder Staff member Licensed User Longtime User Jul 11, 2016 #2 There is no Outlook library. You can use SMTP from the jNet library to send emails. However the user will need to provide their mail server settings. Another option is: Code: Copy Sub ShowMailClient(Address As String, Subject As String) fx.ShowExternalDocument($"mailto:${Address}&subject=${Subject}"$) End Sub Upvote 0
There is no Outlook library. You can use SMTP from the jNet library to send emails. However the user will need to provide their mail server settings. Another option is: Code: Copy Sub ShowMailClient(Address As String, Subject As String) fx.ShowExternalDocument($"mailto:${Address}&subject=${Subject}"$) End Sub
T TonySav Member Jul 12, 2016 #3 Erel said: There is no Outlook library. You can use SMTP from the jNet library to send emails. However the user will need to provide their mail server settings. Another option is: Code: Copy Sub ShowMailClient(Address As String, Subject As String) fx.ShowExternalDocument($"mailto:${Address}&subject=${Subject}"$) End Sub Click to expand... Thanks Erel. I tried your option and it works just fine opening an email and allowing a user to select an address and subject. Is there a method to insert some text dynamically? Upvote 0
Erel said: There is no Outlook library. You can use SMTP from the jNet library to send emails. However the user will need to provide their mail server settings. Another option is: Code: Copy Sub ShowMailClient(Address As String, Subject As String) fx.ShowExternalDocument($"mailto:${Address}&subject=${Subject}"$) End Sub Click to expand... Thanks Erel. I tried your option and it works just fine opening an email and allowing a user to select an address and subject. Is there a method to insert some text dynamically?
Erel B4X founder Staff member Licensed User Longtime User Jul 12, 2016 #4 You can add: $body=... to set the body text. Upvote 0
T TonySav Member Jul 12, 2016 #5 Wow Erel - With so few lines of code such a lot of work is achieved. Is there anywhere I can go to for further information. As you have provided has solved my requirement. However if there are other functions that are accessible it would be appreciated. Font size, delivered True/False etc. Your assistance is very much appreciated. Upvote 0
Wow Erel - With so few lines of code such a lot of work is achieved. Is there anywhere I can go to for further information. As you have provided has solved my requirement. However if there are other functions that are accessible it would be appreciated. Font size, delivered True/False etc. Your assistance is very much appreciated.
Erel B4X founder Staff member Licensed User Longtime User Jul 12, 2016 #6 fx.ShowExternalDocument lets the OS handle the url. In this case it is a mailto url: https://en.wikipedia.org/wiki/Mailto Upvote 0
fx.ShowExternalDocument lets the OS handle the url. In this case it is a mailto url: https://en.wikipedia.org/wiki/Mailto