473,800 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending email using PEAR

15 New Member
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 1439
pbmods
5,821 Recognized Expert Expert
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
7749
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 . You now get an expense paid trip to $location . And that HTML outputted in email..so someone checks their email,they
4
2196
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 correctly ? And if not what would you suggest ? Regards Domin
3
4613
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) and the instructions are 'have your script send a form post with the name of the form fields "AID" and "BID" and their values to the following URL string...' Thanks james
2
1116
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
2969
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 have tried to sent email to 4 to 5 email ids it is going for inbox only but i have a doubt if i send it to more than 100 email id it may go for spam
1
1252
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 domain through PHP. but i can send mails using outlook 2003 i get the following error
7
9847
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 achieve this. Thanks
1
1289
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 question: how can I include images and movies (which tags should I use?). Can I do it using mail() function? I would prefer mail() than PEAR because I am not sure if I will have PEAR on server.
2
4293
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 any thouhgts on how to get it in as an attachment. CODE: <?php ini_set(SMTP, "172.18.1.65");
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.