mail error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • toufik toufik

    mail error

    Hi,
    I'm having the folowing error :
    Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
    missing in c:\....filename

    when I try to send a simple email using the folowing code:
    mail(toufik_i@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");

    I'm running Appache/php/mySql,

    Any help please?
    Thanks



  • Rudolf Horbas

    #2
    Re: mail error

    toufik toufik wrote:
    [color=blue]
    > I'm having the folowing error :
    > Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
    > missing in c:\....filename
    >
    > when I try to send a simple email using the folowing code:
    > mail(toufik_i@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");
    >
    > I'm running Appache/php/mySql,[/color]

    You either have to install a mailserver or connect to Your mailprovider.

    Maybe this helps:


    Rudi

    Comment

    • Pedro Graca

      #3
      Re: mail error

      toufik toufik wrote:[color=blue]
      > I'm having the folowing error :
      > Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
      > missing in c:\....filename
      >
      > when I try to send a simple email using the folowing code:
      > mail(toufik_i@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");
      >
      > I'm running Appache/php/mySql,[/color]

      You have to set up php.ini correctly.
      According to the headers I think you're using Windows so the lines
      to change in php.ini are "SMTP" and "sendmail_from" .

      This script will tell you the current values of your configuration:

      <?php
      echo '<p>SMTP: ', ini_get('SMTP') , '</p>';
      echo '<p>sendmail_fr om: ', ini_get('sendma il_from'), '</p>';
      ?>


      If you just want one script to send mails you may want to try
      reconfiguring just for that one

      <?php
      ini_set('SMTP', '<THE.MAIL.SERV ER.YOU.USE>'); // eg: mx.example.com
      ini_set('sendma il_from', 'YOUR.ADDRESS@T HE.MAIL.SERVER' ); // eg: me@example.com
      // ...
      // rest of the script
      ?>
      --
      --= my mail box only accepts =--
      --= Content-Type: text/plain =--
      --= Size below 10001 bytes =--

      Comment

      • Shawn Wilson

        #4
        Re: mail error

        toufik toufik wrote:[color=blue]
        >
        > I'm having the folowing error :
        > Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
        > missing in c:\....filename
        >
        > when I try to send a simple email using the folowing code:
        > mail(toufik_i@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");[/color]

        Try
        mail(toufik_i@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3", "From:
        your@address.co m")

        Shawn
        --
        Shawn Wilson
        shawn@glassgian t.com

        Comment

        Working...