Page 1 of 1
Specify FROM address
Posted: Tue Jan 09, 2007 5:50 pm
by remlabm
I'm trying to figure out how to manually specify a from address. reasoning:
if the address is valid i want the reply to to be different than the bounce back address... Im trying to collect all bouncing addresses in a single..
if that doesn't make sense let me know and i will try to explain differently
Posted: Wed Jan 10, 2007 2:14 am
by Chris Corbyn
The address in the From: header is the one you give to send(). The bounce-back address (Return-Path, and "MAIL FROM" envelope) is the one passed to $swift->setReturnPath($address), or otherwise, the same as the From: address.
I was going to post a link to the relevant page in the documentation, but now I see why this question crops up so regularly... I forgot to document it
Code: Select all
$swift = new Swift( ... );
$from = "your@address.com";
$bounce_detect = "bounces@address.com";
$swift->setReturnPath($bounce_detect);
//
$swift->send($from, $to, $subject, $message);
Posted: Thu Jan 11, 2007 6:34 pm
by remlabm
something interesting happens... these message im sending are to cell phones. some phones work fine with this method... others set the REPLY address as the BOUNCE address... is there anything that you might no about .... to help fix this?
Posted: Fri Jan 12, 2007 1:37 am
by Chris Corbyn
remlabm wrote:something interesting happens... these message im sending are to cell phones. some phones work fine with this method... others set the REPLY address as the BOUNCE address... is there anything that you might no about .... to help fix this?
Are you using Gmail? Gmail rewrite the email headers unless you add the email address you wish to send from to a list of allowed addresses.
Other SMTP servers could feasibly do the same thing if they are not intended to deliver mail for other domains primarily. It's certainly not a problem with Swift; the process of giving a bounce-detect address is extremely basic

Posted: Fri Jan 12, 2007 11:39 am
by remlabm
no im not using gmail.. i have narrowed it down to the client.. for some reason it reads the last email in the header and sets that to the reply.
it only does it with one client though. everyone else has no issues. i used a work around method to fix this issue.
btw if you need someone to test swift4 php4 let me know i send about 10,000 a day.
and no i dont spam.
Posted: Fri Jan 12, 2007 3:25 pm
by Chris Corbyn
remlabm wrote:no im not using gmail.. i have narrowed it down to the client.. for some reason it reads the last email in the header and sets that to the reply.
it only does it with one client though. everyone else has no issues. i used a work around method to fix this issue.
btw if you need someone to test swift4 php4 let me know i send about 10,000 a day.
and no i dont spam.
I will need somebody to (acceptance) test the PHP4 version shortly actually

I'll likely just post the links here like I did with the PHP5 version. I've been busy with a Java project for the past week so haven't had a chance to work on it but I'm stuck with a references issue I may throw out to the smart people of this forum if I can't solve it soon. Even putting reference operators where I thought PHP5 would pass/assign by-reference by default it's not working somewhere
As for the client issue with the headers... how weird
