473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Sending email using PEAR

I'm using this code:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once "Mail.php";
  3.  
  4. $from ="__MUNGED__";
  5. $to = "__MUNGED__";
  6. $subject = "Hi!";
  7. $body = "Hi,\n\nHow are you?";
  8.  
  9. $host = "__MUNGED__";
  10. $username = "pedjasmek";
  11. $password = "********";
  12.  
  13. $headers = array ('From' => $from,
  14.   'To' => $to,
  15.   'Subject' => $subject);
  16. $smtp = Mail::factory('smtp',
  17.   array ('host' => $host,
  18.     'auth' => true,
  19.     'username' => $username,
  20.     'password' => $password));
  21.  
  22. $mail = $smtp->send($to, $headers, $body);
  23.  
  24. if (PEAR::isError($mail)) {
  25.   print "<p>" . "Message sent". "</p>";
  26.  } else {
  27.   print"<p>Message successfully sent!</p>";
  28.  }
  29. ?>
  30.  
and it won't work.Neither the first or the second message appears.
Dec 26 '07 #1
1 1417
pbmods
5,821 Expert 4TB
Heya, Pedjasmek.

Do you get any error messages? Do you have debugging messages turned on?
Jan 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: philphanluvr | last post by:
How do I sent content of a PHP form via HTML email? For example, fields $name, $city, $state, $phone, $location to HTML: <p>Congratulations $name from $city, $state with the phone # $phone ....
4
by: Domin | last post by:
Hi Is there possible to send e-mail from simple form when the server doesn't have a domain name, and in the internet only can be seen using it IP address ? The mail() function will work...
3
by: james | last post by:
How can I have a php script send data to a URL as form post data from within the script without creating an actual form in a web page. I am working with an affiliate program (from Affiliateshop)...
2
by: Markus Schuster | last post by:
Hi, i'm searching a php script which is able to send mails. It should be able to tune the font size and write a text bold. Any idears? Thanks, Max
1
by: akuva | last post by:
I have to send more than 100s of email using a php code if i use mail function whether it will be sent to spam or inbox. If it is sent to spam which is the other way to send mass email from php. i...
1
chathura86
by: chathura86 | last post by:
hi im using php5, exchange server 2007, and pear Mail and pear mail_mime packeges to send mails. it works fine with-in my domain.but i cannot send mails to addresses which are out side my...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
1
by: r_ahimsa_m | last post by:
Hello, I am learning PHP5 and www technologies. I would like to send email from .php script. The email will contain HTML with images (BMP, GIF, JPEG) and movies (MPEG) included. I have a...
2
by: Erik Witkop | last post by:
So I have been trying to get this to work all day. I can't get a local file on my web server to attach to an email. Right now I have it printing out in the body of the email. Please help me with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.