SMTP problems

Status
Not open for further replies.
Messages
43
Reaction score
0
Points
6
On my site I have a form which records the results of tennis matches and the user emails the contents to me using a form and PHP file which calls PHPMailer.
Sometimes it works and sometimes it doesn't and I am receiving lots of complaints!
I have the latest version of PHPMailer and thought that the problem might be with Google, whose SMTP mail servers I was using.... so I created an account at SMTP2Go and the problem seemed to be resolved - but it isn't! This morning I could receive an email from the site and this afternoon, I couldn't!

Here is my sample code:-

PHP:
<?php
   require('../../PHPmailer/class.phpmailer.php'); // path to the PHPMailer class.
   require('../../PHPmailer/class.smtp.php'); // path to the PHPMailer class.

   $mail = new PHPMailer();
   $mail->SMTPDebug = 2;
   $mail->IsSMTP();
   $mail->Mailer = "smtp";
   $mail->Host = "smtpcorp.com"; //Enter your SMTP2GO account's SMTP server.

   $mail->Port = "2525"; // 2525, 8025, 587 and 25 can also be used. Use Port 465 for SSL.

   $mail->SMTPAuth = true;
   //$mail->SMTPSecure = 'ssl'; // Uncomment this line if you want to use SSL.

   $mail->Username = "smtp_username";
   $mail->Password = "smtp_password";
  
   //$mail->From     = "sender@example.com";
   //$mail->FromName = "Susan Sender";
   //$mail->AddAddress("recipient@example.com", "Rachel Recipient");
   //$mail->AddReplyTo("Your Reply-to Address", "Sender's Name");
   $mail->From     = "FixturesSecretary@NKelsey.co.uk";
   $mail->FromName = "Fixtures Secretary";
   $mail->AddAddress("Allan3642@gmail.com", "FS");
   $mail->AddReplyTo("FixturesSecretary@NKelsey.co.uk", "FS");
   $mail->Subject  = "Hi!";
   $mail->Body     = "Hi! How are you?";
   $mail->WordWrap = 50;
   if(!$mail->Send()) {
        echo 'Message was not sent.';
        echo 'Mailer error: ' . $mail->ErrorInfo;
        exit;
   } else {
        echo 'Message has been sent.';
   }
?>

Here is the error that I received this afternoon:-
2014-06-26 20:21:34 SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed. Message was not sent.Mailer error: SMTP connect() failed.

Can anyone help me to get the PHP file working correctly and reliably?
Thanks in anticipation,
Allan
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
External SMTP connections are not allowed on Free Hosting servers; all mail must go through the outbound spam filter using x10's SMTP.
 
Messages
43
Reaction score
0
Points
6
Hi,
Many thanks for your reply... mystified why it should work some times and not others... but can you advise how I change the PHP file?
thanks in anticipation,
Allan
 
Messages
43
Reaction score
0
Points
6
OK... I have tried lots of permutations and this worked:-
PHP:
<?php
   require('../../PHPmailer/class.phpmailer.php'); // path to the PHPMailer class.
   require('../../PHPmailer/class.smtp.php'); // path to the smtp class.
   $mail = new PHPMailer();
   $mail->SMTPDebug = 2;
   $mail->IsSMTP();
   $mail->Mailer = "smtp";
   $mail->Host = "xo3.x10hosting.com";
   $mail->Port = "25";
   $mail->SMTPAuth = true;
   $mail->Username = "fixturessecretary@nkelsey.x10.mx";
   $mail->Password = password;
    $mail->From     = "FixturesSecretary@NKelsey.x10.mx";
   $mail->FromName = "Fixtures Secretary";
   $mail->AddAddress(email of where it is going, "FS");
   $mail->AddReplyTo("FixturesSecretary@nkelsey.x10.mx", "FS");
... but when I put in these connection parameters into my script the email was not received.... wondering if it something to do with '/n's or '/r's ?
regards
Allan
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Hi Allan,
I took a look at the emails that have been sent from your account. I'm seeing them getting stopped by the outbound scanning system due to being found to have a higher probability of being spam. Here is an example email the system is seeing:

�Email From ��League�Division���Match
Date:����v���Venue������������������������������Winning Team��Losing
Team��Comments :​

I'm seeing this for just about every email that has been sent. Another one contained just the word "test" which was also stopped.

I do also see some emails having made it through that had meaningful content, however.
 
Messages
43
Reaction score
0
Points
6
Hi Byron,
I generated all of those emails... Apart from the one which I sent with 'Test' the others had the type of content that I need from my web site. Team Captains fill in a scorecard on the web site which they 'send' to me using a PHP script from the 'Send' button.
Is there a way to let these through the security system?
Thanks in anticipation.
Allan
 
Messages
43
Reaction score
0
Points
6
Here is what a typical email looks like from the html code:
screenshot%20of%20scorecard.jpg
https://www.dropbox.com/s/aaht0aephqvf6fg/screenshot of scorecard.jpg
 
Last edited:
Messages
43
Reaction score
0
Points
6
Hi there,

Is there a solution to my problem yet - or can anyone suggest another way of reporting the scores?

I had thought of devising an SQL database... but I don't have the knowledge nor the time to learn!

thanks in anticipation,
Allan
 
Messages
43
Reaction score
0
Points
6
Hi again,

Strange thing the other day... I received an email through the system - even though I cannot get it to work for me and still appears to be broken!
:
Scorecard2.jpg

How come some are getting through the system - but some are not?
How can it be made to consistently work - is there anything I can do or is it an Administrative issue?
Allan
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Are all the emails being sent with the same from address? (And also, one that is on your account?)
 
Messages
43
Reaction score
0
Points
6
Hi,

Thank you for your interest.
Here is the part that sends the email to me (the Fixtures Secretary):-

PHP:
//send scorecard info to Fixtures Secretary

  //Set who the message is to be sent to
  $mail->AddAddress($emailfrom) ; //$emailfrom is from the submitted form
  //Set who the message is to be sent from
  $mail->From     = "FixturesSecretary@NKelsey.x10.mx";
   $mail->FromName = "Fixtures Secretary";
  //Set an alternative reply-to address
  $mail->AddReplyTo($emailfrom) ;
  $mail->Subject = $subject ; // subject is from the submitted form
  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!' ; // optional - MsgHTML will create an alternate automatically
  $mail->MsgHTML($messageproper) ;// $messageproper is put together HTML code which includes the table and color coding as well as inputs from the submitted form

// Send the email
  $mail->Send();
//if(!$mail->Send()) {
        //$error = 'Mail error: '.$mail->ErrorInfo;
        //return false;
    //} else {
        //$error = 'Message sent!';
        //return true;
    //}

So I am using a 'From' Email address that I have created on x10 hosting

Hope the portion of code helps identify the problem!

regards
Allan
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Have any emails been sent recently? I don't see that email address in our logs.
 
Messages
43
Reaction score
0
Points
6
Hi there,
Many thanks for checking the logs... and indeed, it seems like the issue is resolved.... fingers crossed!

regards,
Allan
 
Status
Not open for further replies.
Top