SMTP Connect fail()

7 replies · opened Mar 15, 2021

AalmajdalMar 15, 2021

Hello,
first of all, let me express my sincere appreciation for the tremendous work you have done in Canvas package, as well as the documentation which is very informative, and in fact, before sending this ticket to you, I have gone thoroughly through it, as well as I have searched almost all your tickets for a similar issue as mine. I have followed the steps explained by you first for my GoDaddy hosting, but since it imposes a lot of restrictions, I switched to SMTP using my Gmail account, and I turned on (Less Secure App Access).
after all the above, I still receive the error message SMTP Connect fail().
To make it easier for you, I'm uploading the form.php fie from include, test URL, as well as including the form code for you to kindly assist me if the issue isn't from your form side, though, I will contact the hosting provider (GoDaddy)..

Form code:

								<div class="row">
									<div class="col-md-4 form-group">
										<label for="template-contactform-name">Name <small>*</small></label>
										<input type="text" id="template-contactform-name" name="template-contactform-name" value="" class="sm-form-control required" />
									</div>

									<div class="col-md-4 form-group">
										<label for="template-contactform-email">Email <small>*</small></label>
										<input type="email" id="template-contactform-email" name="template-contactform-email" value="" class="required email sm-form-control" />
										<input type="hidden" name="replyto" value="template-contactform-email">
									</div>

									<div class="col-md-4 form-group">
										<label for="template-contactform-phone">Phone</label>
										<input type="text" id="template-contactform-phone" name="template-contactform-phone" value="" class="sm-form-control" />
									</div>

									<div class="w-100"></div>

									<div class="col-md-8 form-group">
										<label for="template-contactform-subject">Subject <small>*</small></label>
										<input type="text" id="template-contactform-subject" name="subject" value="" class="required sm-form-control" />
									</div>

									<div class="col-md-4 form-group">
										<label for="template-contactform-service">Subject</label>
										<select id="template-contactform-service" name="template-contactform-service" class="sm-form-control">
											<option value="">-- Select One --</option>
											<option value="General inquiry">General inquiry</option>
											<option value="Correction, Addition, Suggestion">Correction, Addition, Suggestion</option>
											<option value="On-demand Service">On-demand Service</option>
											<option value="Complain">Complain</option>
										</select>
									</div>

									<div class="w-100"></div>

									<div class="col-12 form-group">
										<label for="template-contactform-message">Message <small>*</small></label>
										<textarea class="required sm-form-control" id="template-contactform-message" name="template-contactform-message" rows="6" cols="30"></textarea>
									</div>

									<div class="col-12 form-group d-none">
										<input type="text" id="template-contactform-botcheck" name="template-contactform-botcheck" value="" class="sm-form-control" />
									</div>

									<div class="col-12 form-group">
										<button class="button button-3d m-0" type="submit" id="template-contactform-submit" name="template-contactform-submit" value="submit">Send Message</button>
									</div>
								</div>

								<input type="hidden" name="prefix" value="template-contactform-">

							</form>
						</div>
SSemicolon WebSTAFFMar 15, 2021

Hello,

Thank You so much for the Kind Words! :)

We have checked out your Website and the Codes and everything appears to be correct, except the fact that GoDaddy is blocking your Forms from sending emails via Gmail because they block the Ports required for the Gmail SMTP to work. They unfortunately force you to use their SMTP Servers. Here is a detailed explanation: https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#godaddy .

So unfortunately, the only Solution right now is to use their SMTP Servers.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

AalmajdalMar 15, 2021

Hello,

Many thanks for the reply.

In fact, before sending the ticket to you, I browsed GitHub and the mentioned link. therefore, I tried the SMTP recommended for GoDaddy, and it did not work too. I browsed the internet and found everybody is talking about the same issue with GoDaddy restrains.
I will update you once a solution is found, so you may kindly notify users when they complain of the same with GoDaddy.

Again,
You are the best, and I wish you to continue so

SSemicolon WebSTAFFMar 16, 2021

Hello,

Very Happy to Help! :)

Thanks for more insights on this. Yes, unfortunately, GoDaddy heavily restricts SMTP usage to their own servers and services. We can completely confirm this because we use Google SMTP ourselves on Live Previews: http://themes.semicolonweb.com/html/canvas/contact.html and there have been no issues whatsoever since the past 3 years.

Regarding the issue, we recommend using GoDaddy SMTP Servers for the time being and also make sure that your $fromemail matches the SMTP Username/Email Domain! This is also a restriction with some hosts.

So if you are using info@biomedresearches.com, your SMTP Email should also be from @biomedresearches.com .

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

AalmajdalMar 17, 2021

Hello, Just to update you with the result of more than 3 hours I spent with GoDaddy yesterday to resolve the issue.
here is their reply:

(Start of quote)"""

Send form mail using an SMTP relay server
If you want to use your website to send form mail, like submissions to a contact us form, you'll need to connect to our mail relay server.
Sending mail through other providers isn't allowed, so you'll need to use the following settings:

Port: 25
SMTP Authentication: False or none
SSL or Secure Connection: None
Server or Host: The relay server you need to use depends on the type of hosting and script

Linux (cPanel)
Use localhost unless:

You use PHP script and the mail() function.
You use Perl script and the /usr/lib/sendmail binary.
In those cases, you do not need to specify a relay server.

Windows (Plesk)
Use relay-hosting.secureserver.net unless you use PHP script and the mail() function, in which case, you do not need to specify a relay server. """

See the following documents:

https://ae.godaddy.com/help/send-form-mail-using-an-smtp-relay-server-953

This code is not correct
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->SMTPAuth = false;
$mail->SMTPAutoTLS = false;
$mail->Port = 25;

SMTP relays send messages through your email account using your existing email client. For example, if your Workspace Email account is set up on Outlook, you can continue to use Outlook to compose and send messages, but the actual messages are processed through our SMTP relaying services.

You can copy whole of belwo code, it will work exactly as it is PHP form:

if(isset($_POST["submit"])){

include('phpmailer/PHPMailerAutoload.php');

//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail->SMTPDebug = 0; // Enable verbose debug output

//SMTP settings start
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'localhost'; // Specify main and backup SMTP servers
$mail->SMTPAuth = false; // Enable SMTP authentication
$mail->Username = ''; // SMTP username
$mail->Password = ''; // SMTP password
$mail->SMTPAutoTLS = false;
$mail->SMTPSecure = false; // Enable TLS encryption, ssl also accepted
$mail->Port = 25;

//Sender
$mail->setFrom('fromemail@domain.com');
//Receiver
$mail->addAddress('yourinbox@domain.com');

//Email Subject & Body
$mail->Subject = 'New Form Submission';
//Form Fields
$mail->Body = '
Name = '$name'
Email = '$email'
Subject = '$subject'
Message = '$message'
';

$mail->isHTML(true); // Set email format to HTML

//Send the message, check for errors
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else {
echo 'Form Submitted Successfully.';
// code for saving in data in database can be added here
}


(End of quote)

What do you think should now be the php script form mailer function? and will it work now?

I spent now three hours with Goddady to get this from them, and I re-made the form with the code they gave me for your kind review and approval.

Have a great day

SSemicolon WebSTAFFMar 17, 2021

Hello,

Firstly, it is highly recommended to not edit the include/form.php File at all except the SMTP area, else nothing will work!

Secondly, the reply from GoDaddy is not useful or informative and very bland to say the least.

Since we have never worked with GoDaddy Servers because of their bas hosting services, we don't know much about this. You will just need the SMTP Details like Host, Port or SSL/TLS Settings, that's it. This is something we found on the web which might help:
[ch_pre type="php"]$mail->isSMTP();
$mail->Host = 'a2plcpnl0426.prod.iad2.secureserver.net'; // Change this with your GoDaddy Hostname
$mail->SMTPAuth = true;
$mail->Username = 'user@domain.com';
$mail->Password = 'password';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;[/ch_pre]

Use the above code in the original include/form.php File in the SMTP Settings area. If this does not work, you will need to contact GoDaddy for further details. Don't change any other core codes except these SMTP Codes.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

AalmajdalMar 17, 2021

Hello,

Absolutely you are right about GoDaddy, I wish you have a hosting service, so we can switch to you after our plan with them ends.
The code didn't work too, BUT ANYHOW, kindly consider the issue is closed as we will not use the contact form for the time being.

You have been very kind and wasted your valuable time and efforts to help solving an issue which is not even related or concerning the services you provided, but though you were ready to help

Thanks is not enough
My sincere appreciation
Regards

SSemicolon WebSTAFFMar 18, 2021

Hello,

Not at all! Very Happy to Help! Your satisfaction is our prime goal. :)

If you are comfortable, you can share your FTP Details with us and we can try looking into this.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard