Jump to content

PHP's Mail - Mail never reaches Inbox! ?!


OilSheikh

Recommended Posts

:D Guys, I am working on this Test PHP Code and it ain't working properly. I never get mail at the Recipient address! The SMTP server is GMAIL.

 

Yes, I HAVE edited PHP.INI and SENDMAIL.

Yes, I HAVE telnetted to the SMTP server and it was a success.

Yes, IT WORKS with MercuryMail ( part of XAMPP) on localhost

 

[move]MAILTEST.PHP[/move]

 

<?

// ---------------- SEND MAIL FORM ----------------



// send e-mail to ...
$to="[email protected]";

// Your subject
$subject="Test";

// From
$header="from: zax <[email protected]>";

// Your message
$message="Hello \r\n";
$message.="This is test\r\n";
$message.="Test again ";

// send email
$sentmail = mail($to,$subject,$message,$header);

// if your email succesfully sent
if($sentmail){
echo "Email Has Been Sent .";
}
else {
echo "Cannot Send Email ";
}

?>


 

[move]PHP.INI -  mail part[/move]

 

[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 25

; For Win32 only.
sendmail_from = [email protected]

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "C:\sendmail\sendmail.exe -t"

 

[move]SENDMAIL[/move]

 

; configuration for fake sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server

smtp_server=smtp.gmail.com

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

;default_domain=local

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

;error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

;debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

[email protected]
auth_password=xxx

; if your smtp server uses pop3 before smtp authentication, modify the 
; following three lines

;pop3_server=
;pop3_username=
;pop3_password=

; to force the sender to always be the following email address, uncomment and
; populate with a valid email address.  this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content

;force_sender=me@localhost

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required

;hostname=localhost

 

Guys, please help me. It's very urgent.

Link to comment
https://forums.phpfreaks.com/topic/48389-phps-mail-mail-never-reaches-inbox/
Share on other sites

Thanks for the reply, shaunrigby.

 

That post was directed at getting the Mail to be delivered to the Inbox instead of the JUNK E-MAIL folder.

 

Thing is, My e-mails  don't even go to JUNK E-MAIL! lol. And I don't mind if the mail is delivered to the junk folder.

 

Hmph. Searching through the Forum didn't reveal much. It seems many PHP mail( ) posts were unanswered.

 

I think I'll try removing my Router and connect through the ADSL Modem and see if it fixes things.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.