Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7490283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:34:35+00:00 2026-05-29T15:34:35+00:00

I got the following code and before sending i check the fields are populated

  • 0

I got the following code and before sending i check the fields are populated or not…when sending the email i get the message ‘We have received your email .’ but i cannot see the email in my inbox, tried it with two different emails but same results… cannot figure out why can you help me please. here is the code:

if($badinput == NULL){ ?>
    <h2>We have received your email .</h2>
    </div>
    <?php

    require_once("libs/inc.email_form.php");

    $email_fields = array(
        "Name"              => $_POST['name'],
        "E-Mail Address"        => $_POST['email'],
        "Telephone Number"      => $_POST['telephone'],
        "Callback"          => $_POST['callback'],
        "Enquiry"           => $_POST['enquiry']
    );

    contact_form( "myemail@yahoo.co.uk",  $_POST['email'], " Enquiry", "test", $email_fields);
}
else
{
    echo $badinput . "</div>";
}
?>

here is the function in libs/inc.email_form.php:

function contact_form($to, $from, $subject, $message, $fields){ 
    if(!$to || !$from || !$subject || !$message || !$fields){
        print form function is missing a variable";
        return false;
    }

    $msg_body = $message."\n\nSubmitted ".date("l, F j, Y, g:i a")." [EST]\n\nSUBMISSION DETAILS:\n";

    // clean up all the variables
    foreach($fields as $k => $v){
        $msg_body .= "\n".$k.": ".clean_var($v);
    }

    // add additional info
    $referer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "could not determine" ;
    $user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : "could not determine" ;
    $msg_body .= "\n\nAdditional Info:\nIP = ".$_SERVER['REMOTE_ADDR']."Browser Info: ".$user_agent."Referral: ".$referer." \r";

    // send it
    $emailer = new emailer;
    if(is_array($to)){
        foreach($to as $t){
            $emailer->send_email($from, $subject, $msg_body, $to);
        }
    }else{
        $emailer->send_email($from, $subject, $msg_body, $to);
    }

    return true;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:34:36+00:00Added an answer on May 29, 2026 at 3:34 pm

    I see no reason for using a class if it’s just probably still using the standard PHP mail() function.

    Please try using this code to test if mail actually get sent:

    if (mail('you@domain.ext', 'subject', 'test email'))
        echo 'Mail was sent';
    else
        echo 'Mail could not be sent';
    

    Also please check the Spam folder as many emails send through PHP mail() get flagged as spam due to incorrect or incomplete headers or because of abuse and bad IP reputation (especially if you’re using shared hosting).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got the following code from here to read an Excel file using
I've got the following code, and the stuff before the javascript echos and the
So I've got the following code written to go through every Anchor, get it's
I have got the following code in a file called test.java which is located
I have got the following code: - (void)tableView:(UITableView *)tableView commitEditingStyle: (UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
I have the following code in C++ and I got the compilation error: a.cpp:
I got a problem, I have this code: $(document).ready(function(){ /* The following code is
I got following code in an XHTML-document and every browser saysit is malformed :(
Ive got the following code which I hacked together from website examples. It works
I got the following code: char buffer[2047]; int charsRead; do { if(fscanf(file, %2047[^\n]%n%*c, buffer,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.