Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

problem with mailto:

Post Reply
donatop
Posts: 5
Joined: Sun Jul 12, 2020 9:36 am

problem with mailto:

Post by donatop »

Hi,
i have written a program with a CEFApplication inside. The program shows a page from a wordpress blog. Everythings works well except for a "mailto:" problem.
Inside the blog (https://www.winxpalnews.it/wp) i have several links to "mailto:...."
if i show the blog from standard browser like Chrome or Firefox, a click to the "mailto" URL works well and a call to the local (local of the computer) application for the mail (like Outlook or Thunderbird) is correctly done and a window is opened (see figure 1)
instead if i open the blog from my program clicks to the URL results in a blank page (see figure 2)

Thanks in advance. Donato.
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4052
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: problem with mailto:

Post by salvadordf »

Hi,

It's a known CEF issue :
https://bitbucket.org/chromiumembedded/ ... lank-after

Try using the TChromium.OnBeforeBrowse event to call ShellExecute in case the URL scheme is "mailto".
donatop
Posts: 5
Joined: Sun Jul 12, 2020 9:36 am

Re: problem with mailto:

Post by donatop »

Thanks, but i have read the CEF Issue, but i don't have understood how to call GetURL from Delphi, unfortunately the example is in C++.
User avatar
salvadordf
Posts: 4052
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: problem with mailto:

Post by salvadordf »

In this case, you would have to read the "request.url" Delphi property instead of calling "request->GetURL()".

The last comment in that issue states that you would have to search the "mailto:" substring inside the request.url value. If you find that value then you call "browser.stopload", set "allow_os_execution" to False and then call the ShellExecute function to let Windows run the default email client in that machine.
donatop
Posts: 5
Joined: Sun Jul 12, 2020 9:36 am

Re: problem with mailto:

Post by donatop »

Thank you. Issue resolved.
Post Reply