Results 1 to 7 of 7

Thread: php function mail () not working within my account

  1. #1
    Join Date
    Apr 2010
    Posts
    79

    php function mail () not working within my account

    I am currently using the application php / mysql business in cpanel. So my problem is that the application works but tells me the mail () function does not work and I can not send mail with this application which is indispensable to me. I go into the php.ini and configure the sendmail but still not sending mail. Can somebody have any solution for it. Please suggest.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: php function mail () not working within my account

    check the code :
    <Php
    mail ('votre_email',' Subject ',' message ');
    ?>

    # You need to Put this code in a file, for example: mymail.php
    # Put this file in your joomla directory.
    # Call the url of your web server with your site and put the name of this file at the end.
    example http://localhost/yoursite/mymail.php

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: php function mail () not working within my account

    I would need to know more about their configuration and then could probably tell you specifically what is wrong within just a couple of seconds. Some of the more common possibilities include:
    * Restricting access for user nobody when PHP is not SuPHP
    * Disabling mail() function
    * Disabled or misconfigured mail server / Configuration
    * Firewall setup incorrectly or has the wrong ports closed
    * Other file permission or configuration issues

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: php function mail () not working within my account

    The mail function Operating mode if you have a local SMTP server on your localhost. You also configure your php.ini pauw meter settings for your ISP (SMTP, and eventual authentication) in this case, it will trigger the mail the same way as Outlook or Thunderbird to name just two regular programs without commercials. To run the file essaimail.php I try to make an alias, I therefore left click on the sign of cpanel nearby clock and Apache-> create an alias alias directory.
    Last edited by opaper; 13-06-2010 at 12:08 AM.

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: php function mail () not working within my account

    You need to Put this code in a file, for example: essaimail.php . put this file in your web directory. I have installed joomla in a partition that I created and Dique called F: / and this partition is also called webserver way to find the file is F: / essaimail.php is it that you meant. Call the url of your web server with your cpanel and put the name of this file at the end.

  6. #6
    Join Date
    Feb 2010
    Posts
    763

    Re: php function mail () not working within my account

    You need to attached this code that works perfectly.
    PHP Code:
    <Php
      ini_set
    ('Error_reporting'E_ALL);
      
    ini_set('Display_errors'1);  
     
      if (
    Mail('Destinataire@domain.tld''Subject''Message')) echo E-mail sent";
      else echo 'Failed ...';
     
    ?> 
    For your php.ini file:

    PHP Code:
    SMTP smtp.free.fr
    smtp_port 
    25
    sendmail_from 
    adresse.valide 
    Regarding your freebox, remember that free blocks port 25 by default and there is a box to uncheck in the interface of your user account. No need to open your port or redirect it to an address of your network, do this instead:
    - Go into your main account
    - Features the Freebox router
    - To enable the routers NAT your Freebox: click here
    - Other features: Set
    - Uncheck: Blocking outbound SMTP (activate)

  7. #7
    Join Date
    Feb 2010
    Posts
    763

    Re: php function mail () not working within my account

    You need to attached this code that works perfectly.
    Code:
    PHP Code:
    <Php

      ini_set
    ('Error_reporting'E_ALL);
      
    ini_set('Display_errors'1);  
      
      if (
    Mail('youremail@domain.com''Subject''Message')) echo E-mail sent";
      else echo 'Failed ...';
     
    ?> 
    Regarding your freebox, remember that free blocks port 25 by default and there is a box to uncheck in the interface of your user account. No need to open your port or redirect it to an address of your network.

Similar Threads

  1. Replies: 4
    Last Post: 11-02-2011, 07:40 AM
  2. Replies: 5
    Last Post: 18-08-2010, 11:49 PM
  3. Multipart mail() function in PHP
    By Gillian Anderson in forum Software Development
    Replies: 6
    Last Post: 14-05-2010, 10:13 AM
  4. Hotmail account cannot send mail to NetZero account
    By jade in forum Technology & Internet
    Replies: 3
    Last Post: 27-07-2009, 08:16 AM
  5. How to send email using PHP mail function
    By killerboy in forum Software Development
    Replies: 2
    Last Post: 15-05-2009, 11:14 AM

Tags for this Thread

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
  •  
Page generated in 1,714,310,946.28268 seconds with 17 queries