Hey zusammen,
vielen Dank vorab für die sinnvolle Erweiterung. Für meinen Anwendungsfall exakt das was ich brauche.
Nun habe ich leider ein Problem mit dem Versenden des Formulars, egal wie ich es anstelle ich bekomme immer folgenden Fehler:
Code:
Fatal error: Uncaught exception Swift_RfcComplianceException with message Address in mailbox given [] does not comply with RFC 2822, 3.6.2. thrown in /xxxx/html/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php on line 308
E-Mail Adressen in Einstellungen und Seitenbaum überprüft, ersetzt - nichts tut sich
Server-Version getestet (mediatemple) - nichts tut sich
Client-Version getestet (1und1) - nichts tut sich
Wende das Formular in einer sehr umgebauten Version der Catalog-List an, dachte daran liegts, alles Umgebaut auf Catalog-Reader - nichts tut sich
Hier noch meine Version der CatalogPowerMailer.php
Form ID: catalogform
Absender: Sender
Fields: Name, Phone, Sender, Message
Table: cat_countries
PHP-Code:
class CatalogPowerMailer extends Controller
{
public function sendTheMail($arrPost, $arrForm, $arrFiles)
{
if ($arrForm['formID'] == 'catalogform') // fill in your Form ID (form setting) -> NOT form CSS-ID!
{
$objMail = new Email();
$this->Import('Database');
$this->Import('Input');
/**
* Use form title as mail subject
*/
$objDbForm = $this->Database->prepare('SELECT * FROM tl_form WHERE id=?')
->limit(1)
->execute('11'); // fill in the record ID of your form
$objMail->subject = $objDbForm->title;
/**
* Choose which field of the form should be used as mail sender
*/
$objMail->from = $arrPost['Sender']; // form field 'Absender'
/**
* Choose which fields of the form should be sent as mail text
* Join fields with: . "\n" .
*/
$objMail->text = $arrPost['Name'] . "\n" . // form field 'Name'
$arrPost['Phone'] . "\n" . // form field 'Telefon'
$arrPost['Sender'] . "\n" . // form field 'Absender'
$arrPost['Message']; // form field 'Mitteilung'
/**
* Use email-field of the active catalog item as mail recipient
* Send mail as soon as it hits the sendTo() command
*/
$objDbCatalog = $this->Database->prepare('SELECT * FROM cat_countries WHERE alias=?') // fill in catalog-table name
->limit(1)
->execute($this->Input->get('items'));
$objMail->sendTo($objDbCatalog->email);
}
}
}
So, irgendjemand eine Idee woran es liegt? Tips? Wäre um alles dankbar!
Wünsche euch ein schönes Wochenende
Lesezeichen