Page 1 of 1
[SOLVED] setReply and set returnPath
Posted: Fri Jun 15, 2007 3:32 am
by brunobraga
Hello.
I'm having some trouble setting reply to and setReturnPath.
Im have the following:
$message =& new Swift_Message($topic);
....
$message->setReturnPath("
bounces@domain.com");
$message->setReplyTo("reply mail");
$message->attach(new Swift_Message_Part(""));
$message->attach(new Swift_Message_Part($content, "text/html"));
in my MESSAGE HEADER the return path and set replay is the same as the mail sender
What am i doing wrong..
Note: using php4
Best regards
Posted: Fri Jun 15, 2007 4:49 am
by Chris Corbyn
Which connection type are you using?
Posted: Fri Jun 15, 2007 4:51 am
by Chris Corbyn
Also, if you're using batchSend() you'll have to make sure you've got the latest version of Swift (3.2.6) since there was a bug in the BatchMailer class which overrode headers in a handful of versions previous.
Posted: Fri Jun 15, 2007 5:15 am
by brunobraga
SMTP, upgrading... perhaps thats the problem..
will post results in a few minutes
Regards and Thanks
Posted: Sun Jun 17, 2007 6:28 pm
by brunobraga
that was the problem.
thanks for the hlp.
Regards,
Bruno
ReturnPath ends up as From:
Posted: Wed Oct 03, 2007 5:40 pm
by rwebler
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello. Swift is great, but there is a buggy behaviour I need help solving: the address we use as ReturnPath is incorrectly used as From (the one outside the envelope). I guess that's not the indended use of ReturnPath. We were using version 3.2.6, but an upgrade to 3.3.1 still let us with the problem. We use PHP5.2.1, and Sendmail as connection. The code is as follows:
Code: Select all
$swift = new Swift(new Swift_Connection_Sendmail());
$swift->attachPlugin(new Swift_Plugin_AntiFlood(200, 10), "anti-flood");
$message = new Swift_Message("Teste");
$message->attach(new Swift_Message_Part("Texto"));
$message->setReturnPath("example@example.com");
$html = file_get_contents("03_envio.htm");
... (build $replacements array)
$swift->attachPlugin(new Swift_Plugin_Decorator($replacements), "decorator");
$objHTML = new Swift_Message_Part($html,"text/html");
$message->attach($objHTML);
$swift->batchSend($message, $recipients, "realsender@example.com");
and the result is:
Code: Select all
From example@example.com Wed Oct 3 16:58:43 2007
Return-Path: <example@example.com>
...
From: realsender@example.com
The first from should be
realsender@example.com.
I hope you can help me.
Best regards, and thanks again for this excellent tool.
Rodrigo
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Posted: Wed Oct 03, 2007 6:24 pm
by Chris Corbyn
Swift doesn't do that, your ISP may be rewriting the headers in the same way Gmail does, or your mail client may simply be showing the Sender address rather than reading the From: header. Those headers are also syntactically incorrect since the From: is missing the colon. It looks more like an adjustment by the mail server to me since it also includes that date. Are you sure there's not a trailing space or two before the word "From"?