Quick Search:
Oracle PL/SQL Code Library
Find Or Post Oracle Jobs
Oracle Discussion & Chat
 PHP Code: Use SendMail Jump to:  
Category: >> PHP Code >> Use SendMail Bookmark and Share

<< lastnext >>

Snippet Name: Use SendMail

Description: Talking to the mail program is like writing to a file. (Perl programmers will be familiar with this technique). Instead of opening a file, the (popen() function specifies a program to pipe (communicate in a standard Unix way) your message to. This makes a connection to the mail program. The puts() function is used to "print" the message headers and message body out to the mail program, connected through the file descriptor already opened with the popen() function. Because you may want to use a different mail program than sendmail, it's a good idea to store this path in variable. You can store the recipient address in a variable to make it easy to change. Here is a simple script to send a message by talking directly to the sendmail program.

Also see:
» Send iCal Email Meeting Requests using...
» Is email deliverable?
» Email attachments with PHP mail()
» Email w/ attachments class
» Heavy-duty SendMail function
» Automatically process email
» Live validation of email address
» Fake email addresses
» Validate email address #3
» Validate email address #2
» Validate email address #1

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

$fd = POPEN("/usr/sbin/sendmail -t","w");
   FPUTS($fd, "To: [email protected] ");
   FPUTS($fd, "From: Me ");
   FPUTS($fd, "Subject: Test message from my web site ");
   FPUTS($fd, "X-Mailer: PHP3 ");
   FPUTS($fd, "Testing. ");

Oracle Magazine
and Oracle White Papers

SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 25 users online    © 2009 psoug.org

Forgot your password?