I have two questions I got stuck on:
1. Is there an easy way to somehow test the connection without sending an email? Something like trying to connect, then disconnecting and returning true or something...
2. Is there a way (probably to write a new "connection" object) to have Swift return a complete assembled source code instead of sending an email?
Thanks in advance.
two questions; about: connections and message source
Moderators: Chris Corbyn, General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: two questions; about: connections and message source
PHP 5:afwt wrote:1. Is there an easy way to somehow test the connection without sending an email? Something like trying to connect, then disconnecting and returning true or something...
Code: Select all
try {
$swift = new Swift($connection);
$swift->disconnect();
echo "Connection works fine...";
} catch (Swift_ConnectionException $e) {
echo "Connection doesn't work";
}2. Is there a way (probably to write a new "connection" object) to have Swift return a complete assembled source code instead of sending an email?
Code: Select all
echo $message->build()->readFull();Code: Select all
$message->setTo('an@address.com');
$message->setFrom('your@address.com');
echo $message->build()->readFull();