roeyhaim Posted January 5, 2011 Share Posted January 5, 2011 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/223468-help-with-phpmailer/ Share on other sites More sharing options...
jlouis123 Posted January 5, 2011 Share Posted January 5, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/223468-help-with-phpmailer/#findComment-1155390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.