blocking all urls but our own.. (email from forms)
Posted: Sun Dec 21, 2008 2:12 am
We're using swift mailer primarily in context of 'contact-us' & 'submission' forms in our site.
Unfortunately it looks like the only emails that make it through are where the 'from_email' ends in our own site's url..
Sending a note to our host simultaneously about this, but suggestions on the script side?
#####
//Everything looks ok, we can start Swift
require_once "include/Swift.php";
require_once "include/Swift/Connection/SMTP.php";
//Create a Swift instance
$swift =& new Swift(new Swift_Connection_SMTP("localhost"));
//Create the recipient from the details we've been given
$sender =& new Swift_Address($from_email, $from_name);
//Create the message to send
$fullmessage =& new Swift_Message("webmail!");
$fullmessage->attach(new Swift_Message_Part($message));
//Try sending the email
$sent = $swift->send($fullmessage, $to_email, $sender);
//Disconnect from SMTP, we're done
$swift->disconnect();
if ($swift){
//success
header("Location: http://www.theleveebreaking.com/staffcontactsuccess.php");
exit();
} else {
header("Location: http://www.theleveebreaking.com/staffco ... ing_failed");
exit();
}
?>
Unfortunately it looks like the only emails that make it through are where the 'from_email' ends in our own site's url..
Sending a note to our host simultaneously about this, but suggestions on the script side?
#####
//Everything looks ok, we can start Swift
require_once "include/Swift.php";
require_once "include/Swift/Connection/SMTP.php";
//Create a Swift instance
$swift =& new Swift(new Swift_Connection_SMTP("localhost"));
//Create the recipient from the details we've been given
$sender =& new Swift_Address($from_email, $from_name);
//Create the message to send
$fullmessage =& new Swift_Message("webmail!");
$fullmessage->attach(new Swift_Message_Part($message));
//Try sending the email
$sent = $swift->send($fullmessage, $to_email, $sender);
//Disconnect from SMTP, we're done
$swift->disconnect();
if ($swift){
//success
header("Location: http://www.theleveebreaking.com/staffcontactsuccess.php");
exit();
} else {
header("Location: http://www.theleveebreaking.com/staffco ... ing_failed");
exit();
}
?>