Hi Pedro,
It doesn't seem to be taking any of the settings in that code. The Mailback email arrived, using the settings entered into the Mailback screen.
I'm also using the referral code in the End Submit textarea (to redirect to another form, passing 3 variables). The passing of variables and redirection to the new form works fine. I put the attachment code before the redirect code. Here's the code (with samples used, not actual emails or links):
$this->execPieceByName('ff_InitLib');
$from = 'address@domain.com';
$fromname = 'From Name';
$subject = 'Your Email Subject'; // Change to your preferred Email subject
$recipient = ff_getSubmit('EmailElementName'); // Change to your admin Email address
$body = '';
$attachment = array('http://domain.com/images/filename.pdf ');
foreach ($this->maildata as $data) {
$body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
}
$this->sendMail($from, $fromname, $recipient, $subject, $body, $attachment); // This line actually emails the form.
$this->execPieceByName('ff_InitLib');
//Change ElementName to the name of the element which value you want to send to form2
$val1 = ff_getSubmit('moduletitle');
$val2 = ff_getSubmit('fullname');
$val3 = ff_getSubmit('useremail');
header("Location: http://domain.com/page?foo1=".$val1."&foo2=".$val2."&foo3=".$val3);
The email should arrive using the email address and From Name in the code (and of course with the PDF file attached), but none of that is happening. It is, however, redirecting as usual with the second segment of code.
Am I doing this wrong? Is that why it's not working?
Thanks,
Wendy