Trying to use Zend mail object

Discussion in 'Customization & add-ons' started by primitive_soul, Mar 5, 2013.

  1. primitive_soul

    primitive_soul New Member

    Joined:
    Oct 11, 2010
    Messages:
    14
    Hi, so I've got a custom php script in a folder in my root folder. It isn't in the amember folder (that I renamed just 'members') because I couldn't post to it when it was. I'm trying to take the post data and email it to an email sent as a post data variable, not the users email. I'm trying to use the method outlined on the API/DI page of the documentation. I've included the 'bootstrap.php' so DI was available to me. It runs the code fine but catches when it trys to send the mail and gives me an error:
    PHP:
    <?php
    include '../members/bootstrap.php';
    if (isset(
    $_POST["submit"])) {
    $Artmail $_POST["eml"];
    $Uname $_POST["uname"];
    $Rname $_POST["realname"];
    $Umail $_POST["umail"];
    $message $_POST["message"];
     
    $subject "Tattoo inquiry from ".$Rname;
     
    $mail Am_Di::getInstance()->mail// create copy of Zend_Mail object, preconfigured by aMember
    $mail->addTo($Artmail$Rname);
    $mail->setSubject($subject);
    $mail->setBodyText($message);
    try {
      
    $mail->send();
    } catch (
    Exception $e) {
      echo 
    "Error sending e-mail: " $e->getMessage() . "\n";
    }
     
    echo 
    "your message was sent ".$Uname;
    }
    ?>
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Please check my reply in other thread about this issue.

Share This Page