Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Sending Mail in Joomla

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 186
    Comment on it

    Sending mail in Joomla is easy. It can be done by posting the value of form in view to the controller.php of that component. Function that can be used is

    function mail() { $fromname = JRequest::getvar('name'); $sender_mail = JRequest::getVar('email'); $recipient = JRequest::getVar('destintation_name'); $recipient_mail = JRequest::getVar('destination_email'); $body = JRequest::getVar('body');

    $mailSender =& JFactory::getMailer();
    $mailSender ->addRecipient($recipient_mail);
    $mailSender ->setSender($sender_mail);
    $mailSender->isHTML(true);
    $mailSender ->setBody($body);
    
    if (!$mailSender ->Send())
        {
                echo "error";       // If not Sent
        }
      else{
    
        $message = JText::_( 'Mail Sent' );
        $this->setRedirect('url', $message);
    
        }
    
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: