Page 1 of 1

Mail not working

Posted: Mon Dec 14, 2009 8:02 pm
by thewanderer
I am having problems with the email on two domains both stores are not sending emails, even though i get the message sent verification, i am not getting email.
I have tested email on the server with this script and it works fine, so why is the store not sending?

Code: Select all

<?php
 if (! empty($_POST['email']) )
 {

  $message=$_POST["message"];
  $email=$_POST["email"];
  $fname=$_POST["fname"];
  $sname=$_POST["sname"];
  $fromadd=$_POST["fromadd"];

  $content = "You have a New Message From {$fname} {$sname}: 
 {$message}";

  ini_set("sendmail_from" , $fromadd);
  $mailSent = false;
  $mailSent = mail( $email, "Website Test Contact Form", $content, "From: 
 $fromadd", "-f".$fromadd );

  if ($mailSent)
  {
    echo 'Mail sent';
  }
  else
  {
    echo 'Problem';
  }
 }
 else
 {

 ?>
 <html>
 <head>
 <title>SendMail Test - </title>
 </head>
 <body bgcolor="white">
 <font face="Verdana" size="-9">
 <p> The From address <b>MUST</b> be Fasthost Based </p> <FORM 
 method="post" action="<? echo $_SERVER['PHP_SELF']; ?>"> <b>From 
 Address: </b><br><INPUT name="fromadd" type="text"><br> <b>First Name: 
 </b><br><INPUT name="fname" type="text"><br>
 <b>Surname: </b><br><INPUT name="sname" type="text"><br> <br> <b>Email 
 Address (To): </b><br><INPUT name="email" type="text"><br> <br> <br> 
 <b>Your Message:</b><br> <TEXTAREA name="message"> </textarea><br> 
 <input type=submit> </FORM>

 </body>
 </head>
 </html>
 <?
 }
 ?>
I have tried changing settings from mail to SMTP but it makes no difference.
Any clues anyone please...

Re: Mail not working

Posted: Mon Dec 14, 2009 10:26 pm
by thewanderer
Finally found the error i think; from error log
2009-12-14 13:56:39 - PHP Notice: fputs() [<a href='function.fputs'>function.fputs</a>]: send of 6 bytes failed with errno=32 Broken pipe in /*/*/*/*/*/*/system/library/mail.php on line 351

Can anyone help please.

Thanks in advance.

Re: Mail not working

Posted: Mon Dec 14, 2009 11:14 pm
by readyman
Have you asked your host about this error? They may have some security restrictions on sendmail. SMTP should work as long as you have the correct access details setup.

Re: Mail not working

Posted: Mon Dec 14, 2009 11:31 pm
by thewanderer
Hi
Thanks for the reply.
I have spoken to the hosting co and they told me to test their mail script which worked fine and will not say anything else as they insist it must be a coding error, but i have not touched anything related to the mail.

Re: Mail not working

Posted: Tue Dec 15, 2009 6:38 am
by thewanderer
Can somebody please give me a clue here, everything worked ok last week, no changes made to script.
Latest error log:

Mon Dec 14 22:33:46 2009] [error] [client ] FastCGI: server "/var/www/fcgi/php-cgi" stderr: Error: MAIL FROM not accepted from server!
[Mon Dec 14 22:33:46 2009] [error] [client ] FastCGI: server "/var/www/fcgi/php-cgi" stderr: Error: RCPT TO not accepted from server!
[Mon Dec 14 22:33:46 2009] [error] [client ] FastCGI: server "/var/www/fcgi/php-cgi" stderr: Error: DATA not accepted from server!
[Mon Dec 14 22:33:46 2009] [error] [client ] FastCGI: server "/var/www/fcgi/php-cgi" stderr: Error: DATA not accepted from server!

??? ???

Re: Mail not working

Posted: Tue Dec 15, 2009 8:02 am
by thewanderer
Fixed it. :) :) :) :)

Re: Mail not working

Posted: Tue Dec 15, 2009 5:15 pm
by i2Paq
thewanderer wrote:Fixed it. :) :) :) :)
Please share your solution. :)

Re: Mail not working

Posted: Tue Dec 15, 2009 6:07 pm
by Daniel
you shoukd not be using fputs if you are using the mail function!

you have got it set to SMTP when your host is telling you to use the built in php mail function. which is what i recommend people to use.

Re: Mail not working

Posted: Sun Jan 03, 2010 2:44 am
by jose3001
I have the same problem i think, the opencart dont send any emails. When i try to recover password, it says an email has been sent but i dont receive it.

What could be the problem/solution?

Thanks!