This topic is locked
[SOLVED]

Email form with multiple email servers

6/22/2024 2:43:00 PM
PHPRunner General questions
M
MikeUk author

I'm developing a web app with a customer liaison section.
Each user can have multiple email addresses, each with different server settings and credentials.
The email addresses and credentials are stored in a separate table and are linked to the user by their user ID.

When a user composes an email, they can select their desired "from" address from a dropdown list populated with their available email addresses.
Upon sending the email, the app will need to automatically load the corresponding server details for the selected address and send the message.

I've learned that multiple server settings can be configured using the onApplicationInit event, but, if I am correct, this runs when the form is loaded.
I did a test, and that seems correct.

My question is: Can I create a function that selects the appropriate server details based on the email domain of the selected "from" address, to set the globalsettings for the mailserver?
Or am I stuck with the applicationInit?

Thank you for reading,

Mike

C
Chris Whitehead 6/23/2024

I'm not sure on where you'd populate those on the fly, you could over ride the phpmailer settings by creating a new object and populating that , this page explains how to do that.

https://asprunner.com/forums/topic/15826-send-mail-with-runner-mail

M
MikeUk author 6/23/2024

Thank you Chris.
I'll give that a go.

Mike