SOLVED IT ! ! !
VBA_php, to use SMTP, you need to send it from your “LOCALHOST” ! BUT, do not use authentication.
Anyway, do this for testing…
Create a PHP file and enter the following code into it. Change the three places that I have X’d out data.
Set the FROM and REPLY-TO both to the email account you are sending from. (This is needed for AOL, Yahoo and some other email addresses as they do not allow relaying from other accounts.
Set the ADDADDRESS to your personal address to make sure you can receive the email.
That’s it. Copy to the “php” folder on your server.
Go to the your-domain/php/mailtest.php file or whatever you called it. and it should send the email out.
NOW, notice, I turned on ALL error tracking and displays. Therefore, you will get a TON of info on the page itself when you go to it. It is just for testing so you can see all details. Of course, take that part out once it is working… Let me know if it works as-is once you get home!
> <?php
> error_reporting(E_ALL); // TEMP ! ! ! ! ! ! ! ! ! ! !
> ini_set("display_errors", 1); // TEMP ! ! ! ! ! ! ! ! ! ! !
>
> /**
> * This example shows making an SMTP connection with authentication.
> */
>
> // Import PHPMailer classes into the global namespace
> ini_set('include_path', 'PHPMailer');
> use PHPMailer\PHPMailer\PHPMailer;
> use PHPMailer\PHPMailer\SMTP;
> use PHPMailer\PHPMailer\Exception;
> require "../PHPMailer/src/PHPMailer.php";
> require "../PHPMailer/src/SMTP.php";
> require "../PHPMailer/src/Exception.php";
>
> //SMTP needs accurate times, and the PHP time zone MUST be set
> //This should be done in your php.ini, but this is how to do it if you don't have access to that
> date_default_timezone_set("America/New_York");
>
> //Create a new PHPMailer instance using SMTP
> $mail = new PHPMailer;
> $mail->isSMTP();
> //Enable SMTP debugging
> // SMTP::DEBUG_OFF = off (for production use)
> // SMTP::DEBUG_CLIENT = client messages
> // SMTP::DEBUG_SERVER = client and server messages
> $mail->SMTPDebug = SMTP::DEBUG_SERVER;
> //Set the hostname of the mail server
> //************************ Change this to Godaddy's SMTP server from your control panel!!!!!
> $mail->Host = 'localhost';
> //Set the SMTP port number - likely to be 25, 465 or 587
> $mail->Port = 25;
> //Whether to use SMTP authentication - true=use it and then you need user/pass info, false=not use it and should work from your server
> $mail->SMTPAuth = false;
> //Set who the message is to be sent from
> $mail->setFrom('XXXXXXXXXXXXXX The Servers Email XXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX NAME ON SERVER EMAIL OR COMPANY NAME XXXXXXXXXXXXXXX');
> //Set an alternative reply-to address
> $mail->addReplyTo('XXXXXXXXXXXXXX The Servers Email XXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX NAME ON SERVER EMAIL OR COMPANY NAME XXXXXXXXXXXXXXX');
> //Set who the message is to be sent to
> $mail->addAddress('XXXXXXXXXXXXXX EMAIL TO SEND TO XXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX NAME TO SEND TO Ernie');
> //Set the subject line
> $mail->Subject = 'PHPMailer SMTP test';
> //Read an HTML message body from an external file, convert referenced images to embedded,
> //Altered text not to you HTML template, but, instead use direct HTML layout
> $temp_HTML = <<<'EOD'
> <!DOCTYPE html>
> <html>
> <head>
> <title>Test Email</title>
> </head>
> <body>
> <h3>Test Email from Ernie...</h3>
> <p>This is just some test email text to see if the email actually works using SMTP!</p>
> </body>
> </html>
> EOD;
> //convert HTML into a basic plain-text alternative body
> $mail->msgHTML($temp_HTML);
> //Replace the plain text body with one created manually
> $mail->AltBody = 'Test Email from Ernie... This is just some test email text to see if the email actually works using SMTP!';
> //Attach an image file
> //$mail->addAttachment('images/phpmailer_mini.png');
> //send the message, check for errors
> if (!$mail->send()) {
> echo 'Mailer Error: ' . $mail->ErrorInfo;
> } else {
> echo 'Message sent!';
> }
> ?>