PHP mailer issue

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

PHP mailer issue

Post by tba »

Have tried to use the contact form wizard to create a contact form. All works well but no emails are sent or received. Have contacted my web host who informs me that the SMTP is not setup or the phpmailer.php either. They also offer the below code as a solution.

So how do I solve this, it shouldn't be rocket science to setup a simple contact form using WYSWYG and as a non-programmer it seems to me that some vital information is not present ...

Grateful for any suggestions
--------------------------------------------------------
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
$mail = new PHPMailer();

$mail->isSMTP();
$mail->Host = 'mailcluster.loopia.se';
$mail->SMTPAuth = true;
$mail->Username = 'user@example.com'; // SMTP username
$mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->CharSet = 'UTF-8';

$mail->From = 'from@example.com';
$mail->FromName = 'Mailer';
$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
$mail->addAddress('ellen@example.com'); // Name is optional
$mail->addReplyTo('info@example.com', 'Information');

$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
User avatar
Pablo
 
Posts: 22476
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP mailer issue

Post by Pablo »

There is no need to edit the code!
You can configure SMTP options in the advanced properties of the form.

Please do not open multiple topics about the same issue:
https://www.wysiwygwebbuilder.com/forum ... hp?t=95961
User avatar
BaconFries
 
 
Posts: 5642
Joined: Thu Aug 16, 2007 7:32 pm

Re: PHP mailer issue

Post by BaconFries »

Have contacted my web host who informs me that the SMTP is not setup or the phpmailer.php either.
As previously your host can provide the correct settings required then once you have these you can configure the SMTP settings in the form properties (Advanced->Mail Engine)

Image
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: PHP mailer issue

Post by tba »

re mail settings

Yes of course and those settings are exactly as described by my web host which begs the question why they say that the phpmailer.php has not been correctly configured and username/pwd double checked as well

Image
User avatar
Pablo
 
Posts: 22476
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP mailer issue

Post by Pablo »

If you have used the correct settings then there is most likely something wrong on the server side.
or the email ended up in spam.
User avatar
BaconFries
 
 
Posts: 5642
Joined: Thu Aug 16, 2007 7:32 pm

Re: PHP mailer issue

Post by BaconFries »

What version of PHP mailer is the server running? for it to work you will need to have PHP 5.6 or higher. Also what does the error log read.

.
Craig
 
 
Posts: 8
Joined: Thu Nov 05, 2015 7:24 pm

Re: PHP mailer issue

Post by Craig »

The information below is from the Loopia website. You are using port 25 for your outgoing mail server. Loopia's email server information specifically says not to use port 25. Without SSL, it says to use port 587. With SSL, use port 465 or with TLS, use 587.

The code that your host sent you uses TLS and port 587.


Email server
To connect with an email client to our mail server, use the following server information. Note that your username is the full email address and we require authentication / verification for outgoing email.

Without SSL
This information is for connections without SSL or TLS. This is the most common option and it works in most email clients.

POP3
Server: mailcluster.loopia.se
Port: 110

IMAP
Server: mailcluster.loopia.se
Port: 143

SMTP
Server: mailcluster.loopia.se
Port: 587 (not 25)

With SSL
If you want to use SSL you should use this information :

POP3
Server: mailcluster.loopia.se
Port: 995

IMAP
Server: mailcluster.loopia.se
Port: 993

SMTP
Server: mailcluster.loopia.se
Port: 465

With
TLS
If you want to use TLS you should use this information instead:

POP3
Server: mailcluster.loopia.se
Port: 110

IMAP
Server: mailcluster.loopia.se
Port: 143

SMTP
Server: mailcluster.loopia.se
Port: 587
tba
 
 
Posts: 46
Joined: Thu Mar 14, 2019 9:35 am

Re: PHP mailer issue

Post by tba »

Thanks, that did the trick
Post Reply