im building a photobooth app whereby a user can take photos and email those photos to themselves, i use phpmailer smtp, the only parameters i pass to phpmailer are the email and the photo names ( because i saved the photos in the server folder right after the photo is taken, therefore i just need to handle the photo name).
the process goes like this: after taking photos, the user enters and submit their email and selected photos by clicking 'send' to send the photos to their email, it will then pass these parameters to the phpmailer to send the photos, and then goes to a thank you page. however, when the user clicks 'send', the process to connect to gmail and attach the photos takes a very long time and the UI is on a loading state, therefore i tried different ways to run the phpmailer process: like open the thank you page after click 'send' and then running phpmailer in a new tab (but i cannot keep the tab focus on the thank you page since js disabled opening a new tab in the background); or after click 'send', redirect to phpmailer but run the thank you page first (however phpmailer will still run the slow email process first before opening the thank you page).
any methods that are simple to use and can help to solve the slow email process? as long as it doesnt affect the UI whereby user needs to wait for the email process to complete before doing anything else, then i will be happy to try
ADD ON: it has to be a public email because my client is not gonna use their corporate side to operate this as there's too many security procedures, and btw im doing this on a windows system. BTW, as a photobooth users, people would want their photos as soon as possible, and using queue and cron is hard to inform the user when the message is sent, therefore that may not be a feasible solution
ADD ON: i cannot store user's email address in any db due to security, so i cannot store the emails somewhere and then send them later using any task scheduling method