how do I get a letter in variable?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
chlorid
Forum Newbie
Posts: 5
Joined: Wed Aug 27, 2008 4:22 am

how do I get a letter in variable?

Post by chlorid »

how do I get a message(header + body) in variable?

I need to write it in a folder "sent"
Last edited by chlorid on Wed Aug 27, 2008 8:19 am, edited 1 time in total.
marcth
Forum Contributor
Posts: 142
Joined: Mon Aug 25, 2008 8:16 am

Re: how do I get a letter in variable?

Post by marcth »

Code: Select all

$variable = 'Letter';
print substr($variable, 0, 1); // L
print substr($variable, 1, 1); // e
print substr($variable, -1); // r
See http://ca3.php.net/manual/en/function.substr.php
chlorid
Forum Newbie
Posts: 5
Joined: Wed Aug 27, 2008 4:22 am

Re: how do I get a letter in variable?

Post by chlorid »

marcth wrote:

Code: Select all

$variable = 'Letter';
print substr($variable, 0, 1); // L
print substr($variable, 1, 1); // e
print substr($variable, -1); // r
See http://ca3.php.net/manual/en/function.substr.php
:) This is not something

Your answer is very originally..
But now i'm worked with Swift Mailer and I need to get full message of mail
I wrote:
$smtpServer='smtp.mydomain.ua';
$subject=$this->getRequestParameter('subject');
$to=$this->getRequestParameter('to');
$text=$this->getRequestParameter('text');

$swift= new Swift(new Swift_Connection_SMTP($smtpServer));
$message= new Swift_Message($subject,$text);
$swift->send($message,$to,'svalera@mydomain.ua');
==> Here I need to get formed message as text
Sorry for my bad english
Post Reply