I want to create in html textbox named b and php code which gets email from it with $_POST. Unfortunately as setBcc is used as an array and I cannot convince php to get emails from this textbox.
This is the code of php:
<?php
require_once 'lib/swift_required.php';
$transport = Swift_MailTransport::newInstance();
$message = Swift_Message::newInstance();
$message->setTo(array(
"manlaughin@interia.pl" => "Nightbitch"
));
$message->setBcc(array('email1@gmail.com', 'email2.gmail.com', 'email3@gmail.com'));
$tekst = 'OK';
$message->setSubject("Funkcjonalności: 3 kategorie, zasady komentarzy");
$message->setBody($tekst,'text/html');
$message->setFrom("no-reply@admin.allegro.pl", "Allegro.pl");
// Send the email
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
and this is the line I want to setup with $_POST:
$message->setBcc(array('email1@gmail.com', 'email2.gmail.com', 'email3@gmail.com'));
Of course I paste email in the textbox with all necessary letters like inside the array.
All I have is this error after replacing emails in an array with $_POST:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/a7018175/public_html/mail2.php on line 10