Problems with the function "mail" of PHP.

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

    Problems with the function "mail" of PHP.

    Hi everybody,

    I have a problem with the function "mail". It returns "true"
    but supposed recipients receive nothing. My code is as follows:

    $to = $form[address1];
    $subject = "E-mail Verification";
    $body = 'The first line\n';
    $body .= 'The second line.';
    $headers = 'From: webmaster@examp le.com';
    $res = mail($to, $subject, $body, $headers);

    I tried to send messages to two different e-mail addresses (to my yahoo
    account and on my university one). No one mail-box got the message. I
    also checked the bulk folder of the yahoo mail, it is also empty. Gould
    you please help me to solve this problem?

  • Good Man

    #2
    Re: Problems with the function "mail&quot ; of PHP.

    "Kurda Yon" <kurdayon@yahoo .comwrote in news:1164554494 .863051.105600
    @f16g2000cwb.go oglegroups.com:
    Hi everybody,
    >
    I have a problem with the function "mail". It returns "true"
    but supposed recipients receive nothing. My code is as follows:
    >
    $to = $form[address1];
    $subject = "E-mail Verification";
    $body = 'The first line\n';
    $body .= 'The second line.';
    $headers = 'From: webmaster@examp le.com';
    $res = mail($to, $subject, $body, $headers);
    >
    I tried to send messages to two different e-mail addresses (to my yahoo
    account and on my university one). No one mail-box got the message. I
    also checked the bulk folder of the yahoo mail, it is also empty. Gould
    you please help me to solve this problem?
    start debugging, at the very least find out what is returned by $res

    Comment

    • Kurda Yon

      #3
      Re: Problems with the function &quot;mail&quot ; of PHP.

      start debugging, at the very least find out what is returned by $res
      The main problem is that I do not know from what should I start the
      debugging. I have no output to analyses. This function is like a
      "black box". I red the description of this function and tried to
      full fill all requirement of the correct usage. But id does not work.

      Comment

      • Good Man

        #4
        Re: Problems with the function &quot;mail&quot ; of PHP.

        "Kurda Yon" <kurdayon@yahoo .comwrote in news:1164577558 .670931.298410@
        45g2000cws.goog legroups.com:
        >start debugging, at the very least find out what is returned by $res
        The main problem is that I do not know from what should I start the
        debugging. I have no output to analyses. This function is like a
        "black box". I red the description of this function and tried to
        full fill all requirement of the correct usage. But id does not work.
        try using this class, it's great, and i presume it will do some debugging
        output in case it fails for you:


        Comment

        • Gordon Burditt

          #5
          Re: Problems with the function &quot;mail&quot ; of PHP.

          >I have a problem with the function "mail". It returns "true"
          >but supposed recipients receive nothing. My code is as follows:
          >
          >$to = $form[address1];
          >$subject = "E-mail Verification";
          >$body = 'The first line\n';
          >$body .= 'The second line.';
          >$headers = 'From: webmaster@examp le.com';
          >$res = mail($to, $subject, $body, $headers);
          The domain example.com has no MX records and no mail server running
          on the host pointed at by the A record. This is more than sufficient
          to drop any mail claiming to be from example.com as SPAM.

          What mail server are you using to send the mail? (Examine your settings
          or the default ones and make sure they are appropriate.) Local sendmail?
          Look at its logs. Did a message come in at all?
          >I tried to send messages to two different e-mail addresses (to my yahoo
          >account and on my university one). No one mail-box got the message. I
          >also checked the bulk folder of the yahoo mail, it is also empty. Gould
          >you please help me to solve this problem?

          Comment

          • Jerry Stuckle

            #6
            Re: Problems with the function &quot;mail&quot ; of PHP.

            Gordon Burditt wrote:
            >>I have a problem with the function "mail". It returns "true"
            >>but supposed recipients receive nothing. My code is as follows:
            >>
            >>$to = $form[address1];
            >>$subject = "E-mail Verification";
            >>$body = 'The first line\n';
            >>$body .= 'The second line.';
            >>$headers = 'From: webmaster@examp le.com';
            >>$res = mail($to, $subject, $body, $headers);
            >
            >
            The domain example.com has no MX records and no mail server running
            on the host pointed at by the A record. This is more than sufficient
            to drop any mail claiming to be from example.com as SPAM.
            >
            What mail server are you using to send the mail? (Examine your settings
            or the default ones and make sure they are appropriate.) Local sendmail?
            Look at its logs. Did a message come in at all?
            >
            >
            >>I tried to send messages to two different e-mail addresses (to my yahoo
            >>account and on my university one). No one mail-box got the message. I
            >>also checked the bulk folder of the yahoo mail, it is also empty. Gould
            >>you please help me to solve this problem?
            >
            >
            Gordon,

            I suspect he was doing exactly as recommended - using example.com when
            posting an example, instead of a real email address which could be
            harvested by spammers.

            I do exactly the same thing when posting code. That's what example.com
            is reserved for.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Petr Vileta

              #7
              Re: Problems with the function &quot;mail&quot ; of PHP.

              "Gordon Burditt" <gordonb.fgp8r@ burditt.orgpíše v diskusním pøíspìvku
              news:12mk8pgk4l 95512@corp.supe rnews.com...
              I have a problem with the function "mail". It returns "true"
              >>but supposed recipients receive nothing. My code is as follows:
              >>
              >>$to = $form[address1];
              >>$subject = "E-mail Verification";
              >>$body = 'The first line\n';
              >>$body .= 'The second line.';
              >>$headers = 'From: webmaster@examp le.com';
              >>$res = mail($to, $subject, $body, $headers);
              >
              The domain example.com has no MX records and no mail server running
              on the host pointed at by the A record. This is more than sufficient
              to drop any mail claiming to be from example.com as SPAM.
              >
              Here you see the reason of your problem :-)
              For example if you are sending mail from domain www.superhost.com then you
              must use some like
              $headers = 'From: gordon@superhos t.com';
              In other word the part of mail after "@" must be the same as your domain
              name after "www."
              --

              Petr Vileta, Czech republic
              (My server rejects all messages from Yahoo and Hotmail. Send me your mail
              from another non-spammer site please.)


              Comment

              Working...