Hi,
$message->attach(new Swift_Message_Part($themessage));
Is that possible? I've tried doing it, it gives no errors, but doesn't display the message.
Any help greatly appreciated!
Using Variable in Message Part
Moderators: Chris Corbyn, General Moderators
-
jackfranklin
- Forum Newbie
- Posts: 2
- Joined: Thu Apr 17, 2008 3:57 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Using Variable in Message Part
Where's the rest of your code? That is certainly possible so something else must be getting done incorrectly 
-
jackfranklin
- Forum Newbie
- Posts: 2
- Joined: Thu Apr 17, 2008 3:57 pm
Re: Using Variable in Message Part
$swift = new Swift(new Swift_Connection_SMTP("my smtp"));
$message = new Swift_Message($subject);
$message->attach(new Swift_Message_Part($themessage));
$message->attach(new Swift_Message_Part("Part of my message", "text/html"));
$recipients =& new Swift_RecipientList();
$recipients->addTo($to);
//Use addCc()
$recipients->addCc($cc);
$recipients->addBcc($bcc);
//Now check if Swift actually sends it
if ($swift->send($message, $recipients, "email@mysite.com"))
My only thought is that it is not finding the variable $themessage, but I'm positive it does. If you can't see anything wrong with the above I'll check again.
$message = new Swift_Message($subject);
$message->attach(new Swift_Message_Part($themessage));
$message->attach(new Swift_Message_Part("Part of my message", "text/html"));
$recipients =& new Swift_RecipientList();
$recipients->addTo($to);
//Use addCc()
$recipients->addCc($cc);
$recipients->addBcc($bcc);
//Now check if Swift actually sends it
if ($swift->send($message, $recipients, "email@mysite.com"))
My only thought is that it is not finding the variable $themessage, but I'm positive it does. If you can't see anything wrong with the above I'll check again.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Using Variable in Message Part
Where does $themessage come from?
Not from a form by any chance? Have you tried:
?
Code: Select all
var_dump($themessage);