Jump to content

simple mail script not working? (zendframework over SMTP)


Recommended Posts

Here is the script, which suppose to send email using smtp over googlemail, but its not working for me don't know why?

 

In my PHP.ini I have got include path directing zend folder which is under the library folder.

 

include_path = ".;C:\Program Files\Apache2.2\htdocs\library"

 

Here is the php script for sending a simple email. real names/emails are used in place of xxx.

 

<?php
require_once("Zend/Mail.php");
require_once("Zend/Mail/Transport/Smtp.php");

$config = array('auth' => 'login',
                'username' => 'xxx@googlemail.com',
                'password' => 'xxx','ssl' =>);

$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);

$mail = new Zend_Mail();

$mail->setBodyText('My Nice Test Text');
$mail->setBodyHtml('My Nice <b>Test</b> Text');
$mail->setFrom('xxx@googlemail.com', 'Islogged);
$mail->addTo('xxx@yahoo.com', 'david');
$mail->addCc('xxx@hotmail.co.uk', 'cameroon');
$mail->setSubject('TestSubject');
$mail->Send();

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.