1

I search all possible solutions to these problems and try but still not working.I contact my server which is webpandahost but they said it is working.

function send_email()
{
    $config['protocol']     = 'smtp';
    $config['smtp_host']    = 'server.multimedia-street.com';
    $config['smtp_port']    = '465';
    $config['smtp_timeout'] = '7';
    $config['smtp_user']    = 'bjmpncr@thefourpobu.com';
    $config['smtp_pass']    = 'admin123';
    $config['charset']      = 'utf-8';
    $config['newline']      = "\r\n";
    $config['mailtype']     = 'text';

    $this->email->initialize($config);

    $this->email->from('bjmpncr@thefourpobu.com', 'SJCDRRMO');
    $this->email->to('ruedastefano@gmail.com');
    $this->email->subject('Password Reset');
    $this->email->message('We have reset your request. Your new password:  Do not reply to this email.');

    if($this->email->send()) {
        echo "success";
    } else {
        echo $this->email->print_debugger();
    }
}

Error message:

The IP address sending this message does not have a
550-5.7.1 PTR record setup. As a policy, Gmail does not accept messages from
550-5.7.1 IPs with missing PTR records. Please visit
550-5.7.1  https://support.google.com/mail/answer/81126#authentication for more
550 5.7.1 information. dn3si12455081pac.266 - gsmtp
halfer
  • 19,824
  • 17
  • 99
  • 186
Tep Tep
  • 59
  • 3
  • 16
  • 3
    if php reports success, then it's NOT a php problem. php's job is the equivalent of walking an envelope down to the street corner and tossing it into the mailbox. that's it. if the mail never gets to the destination, that's not php's problem, it's the postal service's. you have to go look at your mail server's logs. – Marc B Jul 15 '16 at 17:03
  • How about viewing `$email->print_debugger();` even on success? Does it give you the server chat? Pass `$email->send(false);` beforehand. (From 3.0.6 manual). – Progrock Jul 15 '16 at 17:14
  • @Progrock this is the output "The following SMTP error was encountered: Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method." – Tep Tep Jul 15 '16 at 17:23
  • I can't resolve your host: server.multimedia-street.com , is that the correct mail server? – Progrock Jul 15 '16 at 17:31
  • @Progrock I find that in my cpanel in email settings and that is the outgoing server and its smtp port is 465. Is that the problem? if so should I use a mail() not smtp? – Tep Tep Jul 15 '16 at 17:35
  • It may resolve on the server (perhaps it's private?). Try php's `gethostbyname()` for that hostname on your server. – Progrock Jul 15 '16 at 17:36
  • @Progrock haha sorry so what im gonna do for now? – Tep Tep Jul 15 '16 at 17:42
  • You say the host name resolves to an IPV4 on the server. Wild stab in the dark: Try prefixing ssl:// to your smtp host. As here: http://stackoverflow.com/a/23234985/3392762 – Progrock Jul 15 '16 at 17:44
  • Another wild stab in the dark, In the manual there is an `smtp_crypto` config key. Try `tls` or `ssl` as the value instead of the `ssl://` prefix. Isn't the print_debugger giving you any more information? – Progrock Jul 15 '16 at 18:01
  • @Progrock Same error :( – Tep Tep Jul 15 '16 at 18:11
  • Sorry. I just don't know what to do :( – Tep Tep Jul 15 '16 at 18:19
  • From information that you provided and removed earlier it looks as if server.multimedia-street.com and thefourpobu.com resolve to the same IP. Is this where the Php script is hosted? Did you try codeigniter with the mail protocol (not smtp/codeigniters basic example)? Which may go back to Marc B's top tip: check the mail logs on the server. Did you try another to address? Did you check spam folder? – Progrock Jul 15 '16 at 18:25
  • @Progrock I also tried the mail protocol because smtp wont work but still mail also dont work. It says successfully send but no email received. also I check spam folder. This is my 2nd week for this problem and i search every solutions :( how can i check the mail logs on the server? – Tep Tep Jul 15 '16 at 18:35
  • @Progrock I tried to add that line still nothing happens. same error :( – Tep Tep Jul 15 '16 at 18:44
  • @MarcB i check the mail in my hosting. I have a message in inbox that said it is failed to send this is the error. The IP address sending this message does not have a 550-5.7.1 PTR record setup. As a policy, Gmail does not accept messages from 550-5.7.1 IPs with missing PTR records. Please visit 550-5.7.1 https://support.google.com/mail/answer/81126#authentication for more 550 5.7.1 information. dn3si12455081pac.266 - gsmtp – Tep Tep Jul 16 '16 at 03:19

1 Answers1

-4

Try adding 'reply to' in the headers.

Or try this

$headers = "Organization: Sender Organization\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n" ;
$headers .= "Reply-To: Sender Name <sender@yahoo.com>\r\n";
$headers .= 'From: Sender Name <sender@yahoo.com>' . "\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n"; 
$headers  .= "X-Priority: 1\r\n"; 
if (mail('sendTo@email.com', 'Subject', 'message', $headers)) {
   "Mail successful.";  
}else{
   "Mail failed.";
}   
Stephan Sutter
  • 400
  • 2
  • 7