Jump to content

Full mail


jackr1909

Recommended Posts

Hi,

 

I need to send automated HTML emails with PHP for my web-server. I have SMTP with Postfix and Sendmail. When i send an email, it just goes to the spam folder of the mail client (tried with GMAIL as well as Microsoft outlook). Could i have the code for sending emails so they don't go to the spam folder. With full headers, etc.

 

Thanks a lot,

 

Jack

Link to comment
https://forums.phpfreaks.com/topic/258273-full-mail/
Share on other sites

Jackr, care to post the code you're using at the moment and see if we can help or point you in the right direction?

 

At the moment your post is a bit like me going to an auto-store and asking, "My car needs a new head gasket, can I have one please?"

 

Without letting them know what car model, make or year of car I drive.

Link to comment
https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1323906
Share on other sites

I'll jump the gun and bet it's the same issue I used to have. I got around it by changing the "From:" header to "[email protected]" (the actual account sending the email) and adding a "Reply-To:" header for "[email protected]" (the address you want people to reply to)

 

If not set like this and if the originating domain "myhost.com" and the "From" header domain "mydomain.com" do not match, I imagine the spam filters will mark it as spam.

 

It should look kinda like this..

 

<?php
    $header .= "Reply-To: Some One <[email protected]>\n";
    $header .= "Return-Path: Some One <[email protected]>\n";
    $header .= "From: Some One <[email protected]>\n";
    $header .= "Organization: My Organization\n";
    $header .= "Content-Type: text/plain\n";

    mail("[email protected]", "Message Subject", "This is my message.", $header);
?>

 

Edit: Fixed typo.

Link to comment
https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1323914
Share on other sites

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.