in Профессиональное

Отправка email из компонента joomla

Как оказалось это несложно

$user =& JFactory::getUser(); 
$message =& JFactory::getMailer();
$message->addRecipient($user->email); 
$message->setSubject('Your subject string');
$message->setBody("Your body stringnin double quotes if you want to parse the nnewlines etc"); 
$sender = array( 'sender@email.address.org', 'Sender Name' );
$message->setSender($sender);
$sent = $message->send();
if ($sent != 1) echo 'Error sending email';

Источник – http://docs.joomla.org/How_to_send_email_from_components

Write a Comment

Comment

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.