PHP Classes

Mail problem going in spam/junk

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  Mail problem going in spam/junk  >  (Un) Subscribe thread alerts  
Subject:Mail problem going in spam/junk
Summary:Mails are going in spam/junk box
Messages:40
Author:joe
Date:2006-06-10 18:31:56
Update:2009-06-02 18:13:38
 
  1 - 10   11 - 20   21 - 30   31 - 40  

  31. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Haitham Saqallah Haitham Saqallah - 2009-03-09 20:59:27 - In reply to message 30 from Manuel Lemos
Hello

I'm trying to send an email using the test_simple_html_mail_message.php file and its sending but the from address and from name its not apearing.

Please advice regding this problem

Falestiny

  32. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-09 21:29:46 - In reply to message 31 from Haitham Saqallah
You should use this class in conjunction with the MIME message class as it is aware of how to compose and send message properly:

phpclasses.org/mimemessage

  33. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Haitham Saqallah Haitham Saqallah - 2009-03-09 21:40:29 - In reply to message 32 from Manuel Lemos
Hello Manuel,

I'm using the same class and using one of the html test php files.

its sending the message but the sender showing blank and this is my problem

thanks.

  34. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-09 22:11:44 - In reply to message 33 from Haitham Saqallah
Are you using already the MIME message class?


  35. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Haitham Saqallah Haitham Saqallah - 2009-03-09 22:17:12 - In reply to message 34 from Manuel Lemos
yes and here is the code

<?php
/*
* test_simple_html_mail_message.php
*
* @(#) $Header: /home/mlemos/cvsroot/mimemessage/test_simple_html_mail_message.php,v 1.1 2005/02/10 03:45:02 mlemos Exp $
*
*/

require("email_message.php");


/*
* Trying to guess your e-mail address.
* It is better that you change this line to your address explicitly.
* $from_address="born2sad4ever@hotmail.com";
* $from_name="Hamooda";
*/
$from_address=getenv("admin@arabyebay.com");
$from_name=getenv("Araby Ebay Team");

$reply_name=$from_name;
$reply_address=$from_address;
$reply_address=$from_address;
$error_delivery_name=$from_name;
$error_delivery_address=$from_address;

/*
* Change these lines or else you will be mailing the class author.
*/
$to_name="Hamooda";
$to_address="haitham@trsa.es";


$subject="Testing Manuel Lemos' MIME E-mail composing and sending PHP class: HTML message";
$email_message=new email_message_class;
$email_message->SetEncodedEmailHeader("To",$to_address,$to_name);
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
$email_message->SetHeader("Sender",$from_address);

/*
* Set the Return-Path header to define the envelope sender address to which bounced messages are delivered.
* If you are using Windows, you need to use the smtp_message_class to set the return-path address.
*/
if(defined("PHP_OS")
&& strcmp(substr(PHP_OS,0,3),"WIN"))
$email_message->SetHeader("Return-Path",$error_delivery_address);

$email_message->SetEncodedHeader("Subject",$subject);

$html_message="<html>
<head>
<title>$subject</title>
<style type=\"text/css\"><!--
body { color: black ; font-family: arial, helvetica, sans-serif ; background-color: #A3C5CC }
A:link, A:visited, A:active { text-decoration: underline }
--></style>
</head>
<body>
<table width=\"100%\">
<tr>
<td>
<center><h1>$subject</h1></center>
<hr>

<P>Hello ".strtok($to_name," ").",<br><br>
This message is just to let you know that the <a href=\"http://www.phpclasses.org/mimemessage\">MIME E-mail message composing and sending PHP class</a> is working as expected.<br><br>

Thank you,<br>

$from_name</p>
</td>
</tr>
</table>
</body>
</html>";
$email_message->CreateQuotedPrintableHTMLPart($html_message,"",$html_part);

/*
* It is strongly recommended that when you send HTML messages,
* also provide an alternative text version of HTML page,
* even if it is just to say that the message is in HTML,

* because more and more people tend to delete HTML only
* messages assuming that HTML messages are spam.
*/
$text_message="This is an HTML message. Please use an HTML capable mail program to read this message.";
$email_message->CreateQuotedPrintableTextPart($email_message->WrapText($text_message),"",$text_part);

/*
* Multiple alternative parts are gathered in multipart/alternative parts.
* It is important that the fanciest part, in this case the HTML part,
* is specified as the last part because that is the way that HTML capable
* mail programs will show that part and not the text version part.
*/
$alternative_parts=array(
$text_part,
$html_part
);
$email_message->AddAlternativeMultipart($alternative_parts);

/*
* The message is now ready to be assembled and sent.
* Notice that most of the functions used before this point may fail due to
* programming errors in your script. You may safely ignore any errors until
* the message is sent to not bloat your scripts with too much error checking.
*/
$error=$email_message->Send();
if(strcmp($error,""))
echo "Error: $error\n";
else
echo "Message sent to $to_name\n";
?>

  36. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-10 00:12:47 - In reply to message 35 from Haitham Saqallah
That is because you are using the getenv() function. That function is just for guessing the sender name from your server environment. If you want to set the sender values directly, just assign them as strings without using getenv().

  37. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Haitham Saqallah Haitham Saqallah - 2009-03-10 14:46:22 - In reply to message 36 from Manuel Lemos
Thanks alot its working fine now.

I'm trying now to intgrate this code or class with my code but its not working and give me the below error

Fatal error: Cannot redeclare class email_message_class in /home/wwwarab/public_html/pb/includes/email_message.php on line 305


Could you advice or tell me what the easist solution to integrate this class with my code and what I have to do exactly to allow it to work probably.

Thanks in advance.

  38. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-10 14:57:58 - In reply to message 37 from Haitham Saqallah
That means you are including the class script file more than once in your script.

  39. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Anil Kumar Panigrahi Anil Kumar Panigrahi - 2009-06-02 06:27:55 - In reply to message 1 from joe
Hello sir,
I am using php , class.phpmailer.php and class.smtp.php for the sending emails. I am using the plesk vps hosting server, when i am sending mails using these classes then mails sent to the spam folder. The same code using in the another application , then we receive the mails to inbox,
Please help me in this issue.

(sorry for my English).

  40. Re: Mail problem going in spam/junk   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-06-02 18:13:38 - In reply to message 39 from Anil Kumar Panigrahi
I cannot help you regarding phpmailer class because I do not use it.

I recommend that you use the MIME message class as I do. It supports sending messages via SMTP too using this SMTP class and provides means to avoid messages being tagged as spam that prevent them to reach the destination.

phpclasses.org/mimemessage

 
  1 - 10   11 - 20   21 - 30   31 - 40