Jump to content

Help with PHPMailer


roeyhaim

Recommended Posts

Hello.

when i try to send email from my site to gmail it's send the messege to spam.

i have a domain and a mailbox on my server.

this is my code, i there any way to change it so it's not go to spam?

 

<?php
    require_once('./mail/class.phpgmailer.php');
$mail = new PHPGMailer();
$mail->Username = 'username';
$mail->Password = 'password';
$mail->From = 'admin@my-domain.com';
$mail->FromName = 'admin';
$mail->Subject = 'Try Admin';
$mail->AddAddress('any-email@gmail.com');
$mail->Body = 'Hey buddy, heres an email!';
if($mail->Send())
    echo "OK <br>";
else 
    echo "Fail <br>";
?>

Link to comment
Share on other sites

If the email is received and placed in a spam box, that means that PHPMailer worked fine: it delivered the email.

If you don't want it to be placed in the spam box, you have to configure your email agent (GMail, Outlook...) appropriately, usually through rules or white lists.

This is not a PHPMailer or server issue. That's a receiving-side issue.

Link to comment
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.