+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: PHP mail()

  1. #1
    merrillmck is offline x10 Sophmore merrillmck is an unknown quantity at this point
    Join Date
    Jun 2009
    Location
    Florida, USA
    Posts
    134

    PHP mail()

    Can anyone help me with the non-programming steps to create a feedback-form on your site?

    Let's say I create a .php page and use php's built-in mail function. I have a mail setup through X10. What connects my .php page to my X10 mail?

    A good link would also suffice. I'm looking at a php teaching page but not following their explanation.

    Thx,
    PHP noob

  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: PHP mail()

    I'm not sure what the restrictions are on both of these methods right now. mail() may be disabled and fsockopen() still has some restrictions. Here's tutorials on both for you:

    mail(): http://www.w3schools.com/PHP/php_mail.asp

    fsockopen(): http://www.110mb.com/forum/how-to-se...-t28551.0.html
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  3. #3
    merrillmck is offline x10 Sophmore merrillmck is an unknown quantity at this point
    Join Date
    Jun 2009
    Location
    Florida, USA
    Posts
    134

    Re: PHP mail()

    Quote Originally Posted by garrettroyce View Post
    I'm not sure what the restrictions are on both of these methods right now. mail() may be disabled and fsockopen() still has some restrictions. Here's tutorials on both for you:

    mail(): http://www.w3schools.com/PHP/php_mail.asp

    fsockopen(): http://www.110mb.com/forum/how-to-se...-t28551.0.html
    If mail() was disabled, what would be the norm for creating a Feedback or Contact form on a webpage? The fsockopen() you just mentioned?

    Thanks

  4. #4
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: PHP mail()

    Yes, mail() and fsockopen() are the two standard methods.

    You may also consider using a database with the contact information and then periodically checking it for new entries. This is an easier solution, but clearly not as easy for you to use ;)
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  5. #5
    merrillmck is offline x10 Sophmore merrillmck is an unknown quantity at this point
    Join Date
    Jun 2009
    Location
    Florida, USA
    Posts
    134

    Re: PHP mail()

    Quote Originally Posted by garrettroyce View Post
    Yes, mail() and fsockopen() are the two standard methods.

    You may also consider using a database with the contact information and then periodically checking it for new entries. This is an easier solution, but clearly not as easy for you to use ;)
    Anyone have an example of a php.ini file with email configured? I'm learning I need to have one either in public_html or the .php folder.

    Thanks,
    PHP noob

  6. #6
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: PHP mail()

    you can not have your own php.ini file

    normally mail() is enabled, and I think it is re-enabled after maintenance on your server, if not it will be in a near future.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  7. #7
    merrillmck is offline x10 Sophmore merrillmck is an unknown quantity at this point
    Join Date
    Jun 2009
    Location
    Florida, USA
    Posts
    134

    Re: PHP mail()

    Quote Originally Posted by LadyAnna View Post
    you can not have your own php.ini file

    normally mail() is enabled, and I think it is re-enabled after maintenance on your server, if not it will be in a near future.
    If and when php.mail() gets re-enabled, X10 will create a read-only php.ini file that will have my X10 email settings in it? I'm just trying to understand how this all works.

  8. #8
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: PHP mail()

    no, you will not get a php.ini file (at least not one that you can see).

    I'm not 100% sure on how it works for shared hosting. I've only messed with it for my testing environment on my own computer. But I've never seen a php.ini file in my account.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  9. #9
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: PHP mail()

    You have to use ini_set() function to override the default mail settings.

    So, if it says "change the XXXXX setting to YYYYYYY in php.ini" you can do ini_set('XXXXX', 'YYYYYY');

    http://us3.php.net/manual/en/function.ini-set.php
    Last edited by garrettroyce; 07-05-2009 at 04:29 PM.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  10. #10
    merrillmck is offline x10 Sophmore merrillmck is an unknown quantity at this point
    Join Date
    Jun 2009
    Location
    Florida, USA
    Posts
    134

    Re: PHP mail()

    Actually, I was able to get a mail form working using PHP's mail() function.

    Code is from W3schools.com

    http://www.wyrbel.com/contact.php

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  2. PHP mail()
    By banzap in forum Free Hosting
    Replies: 3
    Last Post: 03-12-2008, 08:35 PM
  3. mail() disabled w/ php v2
    By greenie in forum Free Hosting
    Replies: 1
    Last Post: 11-02-2007, 09:06 PM
  4. php mail function not working
    By aenman in forum Free Hosting
    Replies: 1
    Last Post: 10-26-2007, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers