Results 1 to 5 of 5

Thread: Sending email

  1. #1
    panteism is offline x10Hosting Member
    Join Date
    Feb 2012
    Posts
    3

    Unhappy Sending email

    I used to have my website in another webhost and my contact form worked fine. Now, In x10hosting my form doesn't deliver e-mails and I don't get any message error. My code is the following:

    PHP Code:
    <?php
        $name 
    $_POST['name'];
        
    $email $_POST['email'];
        
    $message $_POST['message'];
        
    $from 'From: opep'
        
    $to '[email protected]'
        
    $subject 'Contacto Via OPEP';
        
    $human $_POST['human'];

        
    $body "Nome: $name\nE-Mail: $email\nMensagem: $message";

        if (
    $_POST['submit'] && $human == '4') {
            if (
    mail ($to$subject$body$from)) {
            echo 
    '<p>A sua mensagem foi enviada.</p>';
        } else {
            echo 
    '<p>Algo correu mal com o envio. Tente novamente.</p>';
        }
        } else if (
    $_POST['submit'] && $human != '4') {
        echo 
    '<p>Respondeu erradamente à pergunta anti-spam.</p>';
        }
    ?>
    Why is it happening and how to solve it?

    Thanks in advance

  2. #2
    essellar's Avatar
    essellar is offline Community Advocate
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,683

    Re: Sending email

    In order to stay off of the spamhaus lists (and to prevent fraud), x10Hosting does not allow spoofing of email headers. Your From header needs to be an actual email account on your domain or the mail will be killed by the server before it's sent. You won't get a PHP error, since the PHP part of the job is working properly, but the outgoing mail router will just discard the message.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  3. #3
    panteism is offline x10Hosting Member
    Join Date
    Feb 2012
    Posts
    3

    Re: Sending email

    First of all thank you for your answer Essellar.

    I'm quite new to php, I've tried to make some changes in the code but without success.

    In the other hand, I've created an e-mail in my x10 account - [email protected] - but it seems I can't send or receive anything... I've tried this in the webmail...

    Any tips?

  4. #4
    panteism is offline x10Hosting Member
    Join Date
    Feb 2012
    Posts
    3

    Re: Sending email

    Anyone, please?

  5. #5
    matt_a_nice_guy_200061 is offline x10Hosting Member
    Join Date
    Jun 2011
    Posts
    11

    Re: Sending email

    Quote Originally Posted by essellar View Post
    10Hosting does not allow spoofing of email headers. Your From header needs to be an actual email account


    Your current From field: $from = 'From: opep';

    You have read, comprehended, and then changed your code, right?

Similar Threads

  1. Email not sending
    By dannyb0986 in forum Free Hosting
    Replies: 7
    Last Post: 07-27-2011, 10:10 AM
  2. Replies: 0
    Last Post: 08-12-2010, 11:10 AM
  3. Sending email with ASP.NET in C#
    By wraithlunati in forum Free Hosting
    Replies: 0
    Last Post: 07-24-2009, 02:00 PM
  4. Help me in sending Email
    By Nahid_hossain in forum Scripts, 3rd Party Apps, and Programming
    Replies: 1
    Last Post: 10-22-2008, 11:40 PM
  5. Sending Email
    By persiantnt in forum Free Hosting
    Replies: 0
    Last Post: 06-10-2008, 09:33 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
  •  
dedicated servers