Author Topic: Emails marked as spam  (Read 2278 times)

Gametaku

  • .
  • Founders
  • Posts: 168
  • Karma: +13/-4
  • .
Emails marked as spam
« on: July 24, 2008, 01:41:11 PM »
For the site tryvista.com  I have created a form that is used to send emails out to clients.  However gmail and the least marks the site as spam.  The site is not blacklisted, however it is part of a shared hosting service.  I have tried using php's mail function with following code: (with emails modified

Code: (php) [Select]
$header = "To: ted <ted at tryvista.com>\r\n";
    $header .= "Reply-To: Ted <ted at tryvista.com>\r\n";
    $header .= "Return-Path: Ted <ted at tryvista.com>\r\n";
    $header .= "From: Ted <ted at tryvista.com>\r\n";
    $header .= "Organization: My Organization\r\n";
    $header .= "From: ted at tryvista.com";
    $header .= "\nMIME-Version: 1.0" .
    $header .=    "\nContent-type: text/html; charset=iso-8859-1";
    $title = $_POST['title'];
    $body = $_POST['body'];
    $to = "to;
   $smarty->assign('body', $body);
$message = $smarty->fetch("mail1.tpl");


//$res =mail($to, $title, $message, $header );
   $res = mail($to, $title, $message, $header);

I have also tried using swift runing the basic email test which was also marked as spam. 

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: Emails marked as spam
« Reply #1 on: July 24, 2008, 01:43:38 PM »
I don't think the emails in the header are valid in the "name at host".  I think it needs to be "name@host".  I'd have to double check the RFC to be sure though.

webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Re: Emails marked as spam
« Reply #2 on: July 24, 2008, 02:40:05 PM »
first tip is to use a class that's going to format the header's properly for you.

http://phpmailer.codeworxtech.com/

secondly...make sure you have the proper PTR records and SPF records in DNS for the sending host.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: Emails marked as spam
« Reply #3 on: July 24, 2008, 03:45:34 PM »
Thanks webwhy... Pear has been a pain for me in the past and this is a decent alternative.