Jump to content

Recommended Posts

hey guys im using phpmailer (https://github.com/PHPMailer/PHPMailer) to send mail from my server to users using SMTP...the problem im getting is that when i send a mail it goes stright into the junk mail...how can i please stop this please?

$mail = new \Mail\Mail;
$mail->isSMTP();
$mail->Debugoutput = 'html';
$mail->Host = "****";
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = "****";
$mail->Password = "***";
$mail->setFrom('***', '****');
$mail->addAddress('email@hotmail.co.uk', 'user');
$mail->Subject = 'BiSi - Welcome';
$mail->msgHTML('<a href="test">hello</a>');
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if (!$mail->send()) {
	echo "Mailer Error: ";
} else {
	echo "Message sent!";
}
Link to comment
https://forums.phpfreaks.com/topic/292489-phpmailer/
Share on other sites

if you try using mail()

 

does it give the same result?

 

Here is a basic example from the manual.

(Just change the $to and header addresses  )

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>
Link to comment
https://forums.phpfreaks.com/topic/292489-phpmailer/#findComment-1496695
Share on other sites

Check the headers on the message and take a look at 

 

Return Path:

From: 

are they the same domain names or different?

 

Also What does it say by 

Received-SPF

 

I have the same retrun and from path, not sure what you mean about recieved-SPF but here is the the output im getting when i send the email. Thank you

 

 

 Connection: opening to bisi.bid:25, t=300, opt=array ()

Connection: opened

SERVER -> CLIENT: 220 rlinux20.grserver.gr ESMTP Postfix

CLIENT -> SERVER: EHLO bisi.bid

SERVER -> CLIENT: 250-rlinux20.grserver.gr250-PIPELINING250-SIZE 16777216250-ETRN250-STARTTLS250-AUTH PLAIN DIGEST-MD5 LOGIN CRAM-MD5250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN

CLIENT -> SERVER: STARTTLS

SERVER -> CLIENT: 220 2.0.0 Ready to start TLS

CLIENT -> SERVER: EHLO bisi.bid

SERVER -> CLIENT: 250-rlinux20.grserver.gr250-PIPELINING250-SIZE 16777216250-ETRN250-AUTH PLAIN DIGEST-MD5 LOGIN CRAM-MD5250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN

CLIENT -> SERVER: AUTH LOGIN

SERVER -> CLIENT: 334 VXNlcm5hbWU6

CLIENT -> SERVER: bm9yZXBseUBiaXNpLmJpZA==

SERVER -> CLIENT: 334 UGFzc3dvcmQ6

CLIENT -> SERVER: YTFfQ3MzZzg=

SERVER -> CLIENT: 235 2.7.0 Authentication successful

CLIENT -> SERVER: MAIL FROM:<noreply@bisi.bid>

SERVER -> CLIENT: 250 2.1.0 Ok

CLIENT -> SERVER: RCPT TO:<ricky.powell@hotmail.co.uk>

SERVER -> CLIENT: 250 2.1.5 Ok

CLIENT -> SERVER: DATA

SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF>

CLIENT -> SERVER: Date: Sun, 16 Nov 2014 14:54:53 +0200

CLIENT -> SERVER: To: Ricky Powell <ricky.powell@hotmail.co.uk>

CLIENT -> SERVER: From: "BiSi.bid" <noreply@bisi.bid>

CLIENT -> SERVER: Reply-To: First Last <noreply@bisi.bid>

CLIENT -> SERVER: Subject: BiSi - Welcome Ricky

CLIENT -> SERVER: Message-ID: <78fd33649e5c92f3ac6b165de1090274@bisi.bid>

CLIENT -> SERVER: X-Priority: 3

CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/)

CLIENT -> SERVER: Organization: Sender Organization

CLIENT -> SERVER: MIME-Version: 1.0

CLIENT -> SERVER: Content-type: text/plain; charset=iso-8859-1

CLIENT -> SERVER: X-Priority: 3

CLIENT -> SERVER: X-Mailer: PHP5.5.12

CLIENT -> SERVER: MIME-Version: 1.0

CLIENT -> SERVER: Content-Type: multipart/alternative;

CLIENT -> SERVER: boundary="b1_78fd33649e5c92f3ac6b165de1090274"

CLIENT -> SERVER: Content-Transfer-Encoding: 8bit

CLIENT -> SERVER:

CLIENT -> SERVER: --b1_78fd33649e5c92f3ac6b165de1090274

CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii

CLIENT -> SERVER:

CLIENT -> SERVER: This is the body in plain text for non-HTML mail clients

CLIENT -> SERVER:

CLIENT -> SERVER:

CLIENT -> SERVER: --b1_78fd33649e5c92f3ac6b165de1090274

CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii

CLIENT -> SERVER:

CLIENT -> SERVER: welcome to bisi. really glad you regustered

CLIENT -> SERVER:

CLIENT -> SERVER:

CLIENT -> SERVER:

CLIENT -> SERVER: --b1_78fd33649e5c92f3ac6b165de1090274--

CLIENT -> SERVER:

CLIENT -> SERVER: .

SERVER -> CLIENT: 250 2.0.0 Ok: queued as 9759916E448A

CLIENT -> SERVER: QUIT

SERVER -> CLIENT: 221 2.0.0 Bye

Connection: closed

Link to comment
https://forums.phpfreaks.com/topic/292489-phpmailer/#findComment-1496719
Share on other sites

Yes I can see that.

Lots of factors will play in your mail getting sent to a junk folder, most of which are out of your control.

Just wanted to see if you got the same result with a basic mail() setup.

You know - sort of like a place to start trying to track down a problem.

Maybe your server is blacklisted

Maybe your ip is blacklisted

Maybe its a dynamic ip address

Could be a problem with the DNS record

etc...

 

You can read about spf records in cpanel under email authentication.

Link to comment
https://forums.phpfreaks.com/topic/292489-phpmailer/#findComment-1496743
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.