Thanks for this great script. Everything is working fine for me so far but now I have run into a problem.
When I try to use the function setReturnPath as below in Swift 3.0.1 with PHP 4.4.1 in a script that works fine otherwise I get:
Fatal error: Call to undefined function: setreturnpath()
Is the code below from version 2? How can I use setReturnPath in version 3? I see the function exists in Message.php but if I am supposed to do something else to use this in version 3 I can not figure out what.
Thanks,
Kirk
d11wtq wrote: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
That's my slopiness, sorry. You can actually perform any of the methods laid out for Swift_Message and Swift by referring to $easyswift->message and $easyswift->swift. For example:
Those properties (message and swift) are actually instances of the version 3 API components, EasySwift simply wraps that API into the v2 API. I'll fix that problem in SVN. I'm making a new release soon as several similar minor bugfixes have been made, mostly in the PHP4 version branch.
Sorry, I'm an idiot, I assumed you were using EasySwift and I haven't forgotten to add that method, it is there. setReturnPath() DOES NOT exist in Swift though. You set it in the message itself.
Because the function is in Message.php this is actually one of the first things I tried. The problem was I put it _before_ the line that creates the message :-/ I didn't actually stop to think that $message is actually - the message.
If you are an idiot I don't know what that makes me :-)