PHP Classes

smtp class

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  smtp class  >  (Un) Subscribe thread alerts  
Subject:smtp class
Summary:return path email address has first chacracter cut off
Messages:4
Author:Paul Graham
Date:2011-02-14 13:49:11
Update:2011-02-14 18:07:04
 

  1. smtp class   Reply   Report abuse  
Picture of Paul Graham Paul Graham - 2011-02-14 13:49:11
I have been sending mail using the qmail message class.

I recently switched to the smtp class.

i am finding that the return-path email address is not having the first character cut off?

require("email_message.php");
require("smtp.php");
. . . . .
if(defined("PHP_OS")
&& strcmp(substr(PHP_OS,0,3),"WIN"))
$email_message->SetHeader("Return-Path",$error_delivery_address);

If I replce the above line with
$email_message->SetHeader("Return-Path",'x'.$error_delivery_address);

then the return address is correct in the header?

  2. Re: smtp class   Reply   Report abuse  
Picture of Paul Graham Paul Graham - 2011-02-14 13:51:16 - In reply to message 1 from Paul Graham
Sorry... the above should read that the first charachter of the return-path address IS being cutoff. That is to say peter@abc.com becomes eter@abc.com in the email header

  3. Re: smtp class   Reply   Report abuse  
Picture of Paul Graham Paul Graham - 2011-02-14 14:03:06 - In reply to message 2 from Paul Graham
I have also noticed that if I put an extra character in front of the email return-path address that although it displays correctly in header return-path the envelope sender has the added character?

Return-Path: <bounces@abc.com>

(envelope-sender <xbounces@londonpresscouncil.com>)
by n1nlshrout01.shr.prod.ams1.secureserver.net (qmail-ldap-1.03) with SMTP
for <paul133@abc.co.uk>; 14 Feb 2011 13:54:54 -0000

  4. Re: smtp class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-02-14 18:07:04 - In reply to message 2 from Paul Graham
The MIME message or the SMTP message do not cut any characters. Are you sure the character is not cut elsewhere?

BTW, you should pass just the e-mail address to the Return-Path header.

Notice that return-path is a virtual header. This means that it is just a convention to pass the bounce address.

The SMTP server may choose to rewrite or strip that header, but whatever you put in the header is always ignored by the SMTP server.