SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    auto-mailer function in PHP

    guys...

    Am wondering if there is a function/script in PHP that will auto-mail me when I finish an action.. like registering for a service, or filling up a form. Kinda like what happens at this site if you've forgotten your password.....

    any ideas/general syntax guide?

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://php.net/manual/en/function.mail.php

    The mail() function in php is very handy. You can call it in your script to automate sending an email. Thait is provided your php.ini is configured for it and you have a SMTP server running on your machine. Usually, on a linux box the SMTP server is sendmail or qmail or postfix - I don't know how you configure php to send mail on windoze.

  3. #3
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh man!

    nvm.. just in case anyone drops in on this thread...

    I'm running Windows 2000 Pro, with PHP 4.0 and MySQL.

    Am also on Apache server, all downloaded from the Net. Man.. I need an SMTP server huh. Bummer. Was hoping to be able to implement this function

    You also mentioned "thait is provided your php.ini is configured for it". How do I check if my php.ini is configured or not? What line am I looking for/adding in...

  4. #4
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe i am off my nut in sayig this but from memory you could edit the php.ini file to use your isp's SMTP server..
    Then you could use the mail server without installing an SMTP server!
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  5. #5
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As for what to search for just had a quick look and the mail config is after a line that reads

    [mail function]

    So search for that line and you should be sweet!
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  6. #6
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mad-onion
    Maybe i am off my nut in sayig this but from memory you could edit the php.ini file to use your isp's SMTP server..
    Then you could use the mail server without installing an SMTP server!
    Hmm... ok. here's my problem.. I'm doing this at work.. and I connect to the Net via a proxy server. All I know is the proxy server goes something like proxy.png.intel.com, port 911.

    Do I need to know the office's SMTP incoming server and all that? Sounds complicated.... don't think anyone here knows that.. need to prod further up the corporate ladder..

  7. #7
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mad-onion, sound like you know what the deal is:

    http://php.weblogs.com/stories/storyReader$67

  8. #8
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by freakysid
    mad-onion, sound like you know what the deal is:

    http://php.weblogs.com/stories/storyReader$67
    I faced this same dillemma when i was coding Max-eMail... i was going to debug on windows if it was the last thing i did
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  9. #9
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by infinitium

    Hmm... ok. here's my problem.. I'm doing this at work.. and I connect to the Net via a proxy server. All I know is the proxy server goes something like proxy.png.intel.com, port 911.

    Do I need to know the office's SMTP incoming server and all that? Sounds complicated.... don't think anyone here knows that.. need to prod further up the corporate ladder..
    Hmm proxy server might cause some troubles...just depends!
    Last year we connected to an external SMTP server at school and the proxy allowed it, that doesnt work anymore though :P

    Try connecting to an SMTP server and if it doesnt work then worry....you might be pleasantly suprised!
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  10. #10
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I go through a proxy server too. So I send and receive my mail through the proxy server. I have my mail client (outlook express) set up with the address of the proxy server as the SMTP host. I don't know what the default port is for mail (something like 112 - dunno that was a wild guess), but if the proxy is using another port...

  11. #11
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by freakysid
    I go through a proxy server too. So I send and receive my mail through the proxy server. I have my mail client (outlook express) set up with the address of the proxy server as the SMTP host. I don't know what the default port is for mail (something like 112 - dunno that was a wild guess), but if the proxy is using another port...
    hehe.. problem is.. i don't even know what the incoming/outgoing SMTP server add. is. My mail comes via Outlook 2000.. tried poking around in the "accounts" settings.. no luck. All I know that it's connected to the Microsoft Exchange Server...

    No addresses of any kind....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •