I am using PHPMailer (via SMTP) to send out emails via my websites. I am using a windows 2012 server as my mail server which is using Hmailserver. I am using Mailgun to relay my emails.
Things I have done:
- I have setup and validated my mailgun settings.
- I have tested sending and receiving emails via the server without the relay (works fine).
My dilemma:
- At one stage I am going to have to state the relay information, such as the authentication or hostname. So far, i see two place where i can declare this - see below:
1) Specify via PHPMailer script:
$mail->IsSMTP();
$mail->host = "smtp.mailgun.org";
$mail->Username = "username";
$mail->Password = "password";
2) Specify in hmailserver admin (on the server):
http://puu.sh/cJLpk/c3d548981c.png
Which way do I do this if I want to relay all my emails?