super slow PHPMailer / 123reg

Joined
12 Feb 2006
Posts
17,508
Location
Surrey
i wrote breifly about this issue before on here but looking now to finally solve it, with the help of chatgpt

i was with vidahost, then tsohost, and service was fine. once tsohost got bought out by 123reg, they did some migration thing, and perhaps coincidentally, sending emails from my website using phpmail slowed to a crawl, anything from 5 seconds to 15 seconds.

i've endured but now looking to fix this issue once and for all. chatgpt has been at my side and helping me through this, but it seems the main issue is my host, 123reg, with slow response time.

SMTP Delay (13 seconds is slow!)


  • The main delay is here:


    2025-03-13 00:21:34 CLIENT

  • 2025-03-13 00:21:47 SERVER
  • CLIENT:250 OK


  • That’s 13 seconds waiting for GoDaddy’s mail server!

so i'm wondering what to do. chatgpt suggest changing smtp provider as godaddy (i guess this is the same company as 123reg) is too slow.

my issue though is that surely the paid for service with 123reg is going to be better than a free service from the likes of gmail? and what about spam factor, will gmail smtp result in a higher rate of being marked as spam?

one thing i should note is that max we send around 60 emails a day in the busy period and this is spread out througout the day, but it's much closer to 5-10 in quieter periods (winter)
 
Last edited:
What has 123reg said about it?

This is a guess but could it be related to DNS in some way? i.e. the speed at which your web page can be authenticated to be able to use the mailserver, involving MX record setup of your domain.
 
i haven't spoke to them yet. i have a tab open to give them a call tomorrow in the day. long gone are the days of vidahost and their speedy online chat at all hours of the night!
 
Last edited:
i haven't spoke to them yet. i have a tab open to give them a call tomorrow in the day. long gone are the days of vidahost and their speedy online chat at all hours of the night!
I've called them quite a few times and they always seem fast to respond..

Sending emails from your Web site? As in a contact form?
 
with no issues of emails being marked as spam?

while i have this thread, is it better for trust by the recipients email provider to have emails sent from an address like contact@domain, or noreply@domain.
 
Do you have SSH access to a machine that the script is running from?

If so, "swaks" is a useful SMTP troubleshooting tool that will show how long each step of connecting/TLS/auth/sending takes. Pipe it through "ts" and you get absolute timestamps too:

Code:
swaks \
--show-time-lapse \
--server smtpout.secureserver.net \
--protocol SSMTPA \
--from [email protected] \
--to [email protected] \
--auth LOGIN \
--auth-user username \
--auth-password password \
| ts %H:%M:%S

You can set --protocol depending on what your SMTP relay needs:

* SMTP = no encryption, port 25, no authentication
* ESMTP = STARTTLS, port 25, no authentication
* ESMTPA = STARTTLS, port 25, with authentication
* SSMTP = TLS, port 465, no authentication
* SSMTPA = TLS, port 465, with authentication

If a server has both A/AAAA DNS records and the machine doesn't have IPv6 setup correctly, then sometimes it'll try defaulting to IPv6 and failing, then falling-back to IPv4 - try forcing IPv4 (-4) or IPv6 (-6).
 
Do you have SSH access to a machine that the script is running from?

If so, "swaks" is a useful SMTP troubleshooting tool that will show how long each step of connecting/TLS/auth/sending takes. Pipe it through "ts" and you get absolute timestamps too:

Code:
swaks \
--show-time-lapse \
--server smtpout.secureserver.net \
--protocol SSMTPA \
--from [email protected] \
--to [email protected] \
--auth LOGIN \
--auth-user username \
--auth-password password \
| ts %H:%M:%S


thanks. this is the exact code i use. how would i insert swaks into this?

PHP:
$mailCopy = new PHPMailer(TRUE);

try {
    
    //Server settings
   $mailCopy->isSMTP();
   $mailCopy->Host = 'mail.213213.co.uk';
   $mailCopy->SMTPAuth = TRUE;
   $mailCopy->SMTPSecure = 'ssl';
   $mailCopy->Username = '[email protected]';
   $mailCopy->Password = '12345';
   $mailCopy->Port = 465;   
   /* Enable SMTP debug output. */
   //$mailCopy->SMTPDebug = 2;   
  
  
    //Recipients
   $mailCopy->setFrom($your_email, $busi);
   $mailCopy->addAddress($email, $fullname);
   $mailCopy->addReplyTo($your_email, $busi);
  

  
   //Content
   $mailCopy->Subject = $fullname.', here\'s your quote';
   $mailCopy->Body = $body_quote;
   $mailCopy->IsHTML(true);

  
    $mailCopy->send();
    
    //echo '<br />Message copy has been sent';
} catch (Exception $e) {
    echo '<br />Message copy could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
}
 
swaks looks like a CLI command ... I don't think you'd want to be making a system call from PHP ;)

How is your PHP app hosted ? Do you have a local SMTP relay that you can use instead of trying to send mail from PHP ?

I have postfix setup as a smart relay. PHP posts locally ... job done. Any issues with mail servers, routing or connecting is managed by postfix
Sending mail via PHP directly is a risk as you'll surely encounter connection issues, dropped mail etc whereas a local smart relay will try to send any failed mail again after a certain amount of time
 
swaks looks like a CLI command ... I don't think you'd want to be making a system call from PHP ;)

How is your PHP app hosted ? Do you have a local SMTP relay that you can use instead of trying to send mail from PHP ?

I have postfix setup as a smart relay. PHP posts locally ... job done. Any issues with mail servers, routing or connecting is managed by postfix
Sending mail via PHP directly is a risk as you'll surely encounter connection issues, dropped mail etc whereas a local smart relay will try to send any failed mail again after a certain amount of time
it's not an app but just from within a website. the user goes through an online form and it sends them an email copy of the quote, and then from the admin side i can send further premade follow up emails. i click a button and it sends using phpmailer.

here's the form - https://www.mayercleaning.co.uk/online-quote/



i'll be honest but i have no idea about what else you've mentioned in your psot.
 
Last edited:
i was with vidahost, then tsohost, and service was fine. once tsohost got bought out by 123reg, they did some migration thing, and perhaps coincidentally, sending emails from my website using phpmail slowed to a crawl, anything from 5 seconds to 15 seconds.
It's all GoDaddy* infrastructure now and their whole mail systems/SMTP relays are flogged and completely unreliable.
Spam being rife on the network seems to be one consensus but i've never gotten a straight answer out of them over the last 18 months or so across the multiple VPS we have/had mail issues with.
Only solution i found was to offload mail to a third-party SMTP relay/provider and even then i had to opt for an "API" solution as port 25 was blocked (they won't open it as it's "blocked network level") and other mail ports didn't play ball with them saying they've got no idea as to why :rolleyes:

I'd run to a new host personally but if you can't, then use a third-party mail provider/relay.

* Host Europe purchased Paradigm (TSOHost, Vida etc) in 2015, GoDaddy purchased Host Europe in 2020 and have been migrating customers to their infrastructure over the last few years.
 
Last edited:
i plan to move to stablepoint, it's just having the time to prepare for the move and any issues that follows.

Had enough of these cheap providers.

Not sure if Oracle Cloud still provide a free virtual machine with 4vCPU and 24 gigs of ram :eek:
I've been running two accounts for 3 years. Only caveat is that it's ARM and you will need to brush up on your linux skills

EDIT: Still available but if I recall correctly, getting one allocated was a PITA
 
Last edited:
i plan to move to stablepoint, it's just having the time to prepare for the move and any issues that follows.
Sure but it'll save you a lot of headaches as GoDaddy is quite frankly ****.
FYI, to try and minimise issues for customers with a host move, provision host and move the site under a new domain or subdomain, test the daylights out of it and then only point the current/business domain to it when it's done.

As said, you're only other solution is go with a third-party relay (Brevo is around £6p/m) as there's no real fix for GoDaddy's mail deliverability.

Not sure if Oracle Cloud still provide a free virtual machine with 4vCPU and 24 gigs of ram :eek:
OC is great but i'm not sure i would be using a free service, that's predominantly meant for learning, to host a business website given T&C's and the lack of proper support.
 
Back
Top Bottom