Newb problem sending mail from form
Posted: Tue May 13, 2008 7:22 pm
Hi all,
trying to send a basic email from a web feedback document and getting an error on the swift send part.
the swift_mail.php looks like this.
<?php
require_once "/homepages/3/.../htdocs/swift/Swift.php";
require_once "/homepages/3/.../htdocs/swift/Swift/Connection/NativeMail.php";
$to_email = 'myemail@yahoo.com';
$subject = 'subject';
$text = 'From: ' . $_REQUEST['name'] . "\n\n" . $_REQUEST['data'];
$from_email = $_REQUEST['email'];
//Create the message
$message =& new Swift_Message($subject, $text);
//Now send it
$swift->send($message, $from_email, $to_email);
?>
Once the form is submitted I get
Fatal error: Call to a member function send() on a non-object in /homepages/3/d244140422/htdocs/swift_mail.php on line 14
The 'name' 'data' and 'email' are all pulled from the form and are valid.
It worked before with mail() but the messages kept going to junk, I was told by a friend to try swiftmailer.
Any ides where to look, have looked through the forums but i'm new to this and can't see an answer.
Thanks in advance.
trying to send a basic email from a web feedback document and getting an error on the swift send part.
the swift_mail.php looks like this.
<?php
require_once "/homepages/3/.../htdocs/swift/Swift.php";
require_once "/homepages/3/.../htdocs/swift/Swift/Connection/NativeMail.php";
$to_email = 'myemail@yahoo.com';
$subject = 'subject';
$text = 'From: ' . $_REQUEST['name'] . "\n\n" . $_REQUEST['data'];
$from_email = $_REQUEST['email'];
//Create the message
$message =& new Swift_Message($subject, $text);
//Now send it
$swift->send($message, $from_email, $to_email);
?>
Once the form is submitted I get
Fatal error: Call to a member function send() on a non-object in /homepages/3/d244140422/htdocs/swift_mail.php on line 14
The 'name' 'data' and 'email' are all pulled from the form and are valid.
It worked before with mail() but the messages kept going to junk, I was told by a friend to try swiftmailer.
Any ides where to look, have looked through the forums but i'm new to this and can't see an answer.
Thanks in advance.