Coding email with PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • buck1942
    Sergeant

    • Mar 2010
    • 20

    Coding email with PHP

    The following little program, that WORKS on two other servers that I use, will not work on Voda... would someone take a look and see what the problem might be?

    The problem:No email is sent to me (rosco)

    I also have the same problem when using Voda's form builder... that is, no email is ever sent.

    Thank you,

    Buck
    Domain name:buckswebsite.net

    <HTML>
    <BODY>
    <?php
    // The message
    $message = "Line 1\nLine 2\nLine 3";
    // In case any lines are larger than 70 characters, use wordwrap()
    $message = wordwrap($message, 70);
    // Send
    mail('rosco@bellsouth.net', 'My Subject555', $message);
    ?>
    </BODY>
    </HTML>
    The Buck Stop
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Coding email with PHP

    You are missing the headers, so probably it gets blocked:

    $header = 'From: you@yourdomain.com \n';
    $header .= 'Reply-To: you@yourdomain.com \n';
    $header .= 'MIME-Version: 1.0\n';
    $header .= 'Content-Type: text/plain';
    $header .= 'X-Mailer: PHP v'.phpversion().'\n';

    mail('rosco@????????.net', 'My Subject555', $message, $header);
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • buck1942
      Sergeant

      • Mar 2010
      • 20

      #3
      Re: Coding email with PHP

      Still no luck... code now reads:

      <HTML>
      <BODY>
      <?php
      $header = 'From: you@yourdomain.com \n';
      $header .= 'Reply-To: someone@yourdomain.net \n';
      $header .= 'MIME-Version: 1.0\n';
      $header .= 'Content-Type: text/plain';
      $header .= 'X-Mailer: PHP v'.phpversion().'\n';

      // The message
      $message = "Line 1\nLine 2\nLine 3";
      // In case any of our lines are larger than 70 characters, we should use wordwrap()
      $message = wordwrap($message, 70);
      // Send
      mail('someone@somedomain.net', 'My Subject555', $message, $header);
      ?>
      msg should have been sent
      </BODY>
      </HTML>
      The Buck Stop

      Comment

      • buck1942
        Sergeant

        • Mar 2010
        • 20

        #4
        Re: Coding email with PHP

        Also, I get the same results when I create a form using Voda's template #2... the form generates without error, gets uploaded to my site, but will not send an email to me.

        I get the msg:

        "Thank you, your submission has been successfully submitted."

        but no email is received.

        Buck
        The Buck Stop

        Comment

        • navaldesign
          General & Forum Moderator

          • Oct 2005
          • 12080

          #5
          Re: Coding email with PHP

          I can assure you thatthe code DOES work.

          Use this:

          <?php
          $header = "From: you@yourdomain.com \n";
          $header .= "Reply-To: you@yourdomain.net \n";
          $header .= "MIME-Version: 1.0\n";
          $header .= "Content-Type: text/plain";
          $header .= "X-Mailer: PHP v \n";
          // The message
          $message = "Line 1\nLine 2\nLine 3";
          // In case any of our lines are larger than 70 characters, we should use wordwrap()
          $message = wordwrap($message, 70);
          // Send
          if(!mail('emailto@anotherdomain.com', 'My Subject555', $message, $header)){
          die("mail was not sent");
          }
          ?>

          Replace you@yordomain.com with your real email address, and emailto@anotherdomain with the receivers email address.

          You would also want to use it by itself to see if it works, then embedd it in your page.

          If it doesn't send an email, it will report it.

          If it doesn't, it means thatthe mail is sent but is somewhere blocked by your ISP or your spam filters
          Navaldesign
          Logger Lite: Low Cost, Customizable, multifeatured Login script
          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

          Comment

          • buck1942
            Sergeant

            • Mar 2010
            • 20

            #6
            Re: Coding email with PHP

            Navaldesign,

            SUCCESS!... at least partial. It works when I send email to HOTMAIL.COM (from my Voda site). It does not work when I send it to my regular email account (bellsouth.net, taken over by att.net). I am using IE8.

            Now the strange thing is that I can copy your code to, two other sites that I use and they both send email to my bellsouth.net account.

            I have IE8 set to the lowest rejection level for emails: No Automatic Filtering.

            Nonetheless, I thank you for your interest and time. At least now, I have a "work around" but I will still look into a solution and as to what might be causing emails to be, sometimes, blocked.

            If I discover something, I will post what I have found out...

            Thank you again,

            Buck
            The Buck Stop

            Comment

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #7
              Re: Coding email with PHP

              IE has nothing to do with it.
              Since I have long experience with form processors and spam filters due to my work, I can assure you that the code sends the mail. However, many ISP providers /bellsouth.net included) have some very strict filters. These filters may include comparison of the senders email address with the domain / server they have been sent to, or looking if the server is somehow blacklisted in any way (some VH customers abuse their hosting and send spam, and this results in blacklisting the entire server), comparison of the sender / receiver email address (if same, they assume it is spam) etc.

              You'd better submit a support ticket to bellsouth.net to ask them.

              It is always wise that you use, as sender's address, an email address within your own domain.

              If you feel like going futher, you could try using PHP mailer, and send mail through SMTP with authentication.

              Requires some knowledge of PHP.
              Navaldesign
              Logger Lite: Low Cost, Customizable, multifeatured Login script
              Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
              DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
              Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

              Comment

              • buck1942
                Sergeant

                • Mar 2010
                • 20

                #8
                Re: Coding email with PHP

                Navaldesign,

                At last, with suggestions from you, and a LOT of searching the net, I have found the problem and taken care of it... at least for now.

                Come to find out, the emails were going to the Bellsouth.net (att.net) Webmail account just fine. However, Bellsouth.net routed the msgs to a Spam folder and was NOT forwarding the msgs onto Windows Live.

                Solution: I logged on to att.net, clicked on MAIL, clicked on OPTIONS (small letters in the upper right corner), clicked on MORE OPTIONS..., clicked on POP & FORWARDING, clicked on "Allow your att.net Mail to be POPed", selected "include spam messages" (in the drop down window), clicked on "Save Changes" and exited...

                This was like finding a needle in a haystack, but I was confident that you were sure that the msgs were being sent... hence I kept looking for a solution.

                Thank you,

                Buck
                The Buck Stop

                Comment

                Working...
                X