NYCPHP Meetup

NYPHP.org

[nycphp-talk] Emailing from a PHP script

PaulCheung paulcheung at tiscali.co.uk
Tue Oct 9 08:37:48 EDT 2007


It must be my birthday today. As I have managed to solve my two knottiest problems today.
Here is the solution to my email problem

<?php session_start; ob_start;
    ini_set("SMTP", "smtp.isp.com");
    ini_set("smtp_port", "25");
    ini_set("sendmail_from", admin at isp.com);

   $to  = "johndoe at hotmail.com";
   $subject  = "Enter your subject here";

   $message = "YES IT WORKED @ LONG LAST
                        I can put anything I like here";

   
   $from  = "FROM: admin at isp.com "; 
   mail("$to", "$subject", "$message", "$from");

   echo "The email has been sent";
?>

I hope this helps others who are wrestling with the same problem
  
  ----- Original Message ----- 
  From: PaulCheung 
  To: NYPHP Talk 
  Sent: Friday, September 14, 2007 4:34 PM
  Subject: Re: [nycphp-talk] Emailing from a PHP script


  Thanks for the solution. I've tried it and it did not work for me
  changed php.ini to reflect change rebooted my system. Don't really understand why it is necessary to download QK SMTP 
  Has all my problems been something to do with XAMPP under windows??

  Paul

    ----- Original Message ----- 
    From: Jason Sia 
    To: NYPHP Talk 
    Sent: Friday, September 14, 2007 4:00 PM
    Subject: Re: [nycphp-talk] Emailing from a PHP script


    ok that will not really work 
    you should use SMTP=localhost then download QK SMTP Server to make this work.


    ----- Original Message ----
    From: PaulCheung <paulcheung at tiscali.co.uk>
    To: NYPHP Talk <talk at lists.nyphp.org>
    Sent: Friday, September 14, 2007 10:37:11 PM
    Subject: Re: [nycphp-talk] Emailing from a PHP script


    Yes, that is correct.
    Has this anything to do with my problem?


      ----- Original Message ----- 
      From: Jason Sia 
      To: NYPHP Talk 
      Sent: Friday, September 14, 2007 3:24 PM
      Subject: Re: [nycphp-talk] Emailing from a PHP script


      you are just using XAMPP for windows right?


      ----- Original Message ----
      From: Ken Robinson <kenrbnsn at rbnsn.com>
      To: NYPHP Talk <talk at lists.nyphp.org>
      Sent: Friday, September 14, 2007 9:32:07 PM
      Subject: Re: [nycphp-talk] Emailing from a PHP script


      At 09:09 AM 9/14/2007, PaulCheung wrote:
      >Can anybody see what I am doing wrong??
      >
      >I have set php.ini (as per the manual) to my email settings
      >======================================
      >[mail function]
      >; For Win32 only.
      >SMTP = smtp.tiscali.co.uk
      >smtp_port = 25
      >
      >; For Win32 only.
      >sendmail_from = paulcheung at tiscali.co.uk
      >========================================================
      >I run the script and the following message appears

      Did you restart your web server (Apache?) after making the changes to 
      the PHP.INI file? This has to be done for the changes to take affect.

      Ken 

      _______________________________________________
      New York PHP Community Talk Mailing List
      http://lists.nyphp.org/mailman/listinfo/talk

      NYPHPCon 2006 Presentations Online
      http://www.nyphpcon.com

      Show Your Participation in New York PHP
      http://www.nyphp.org/show_participation.php




      Send instant messages to your online friends http://uk.messenger.yahoo.com 


      _______________________________________________
      New York PHP Community Talk Mailing List
      http://lists.nyphp.org/mailman/listinfo/talk

      NYPHPCon 2006 Presentations Online
      http://www.nyphpcon.com

      Show Your Participation in New York PHP
      http://www.nyphp.org/show_participation.php



    Send instant messages to your online friends http://uk.messenger.yahoo.com 


----------------------------------------------------------------------------


    _______________________________________________
    New York PHP Community Talk Mailing List
    http://lists.nyphp.org/mailman/listinfo/talk

    NYPHPCon 2006 Presentations Online
    http://www.nyphpcon.com

    Show Your Participation in New York PHP
    http://www.nyphp.org/show_participation.php


------------------------------------------------------------------------------


  _______________________________________________
  New York PHP Community Talk Mailing List
  http://lists.nyphp.org/mailman/listinfo/talk

  NYPHPCon 2006 Presentations Online
  http://www.nyphpcon.com

  Show Your Participation in New York PHP
  http://www.nyphp.org/show_participation.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071009/1ea63887/attachment.html>


More information about the talk mailing list