SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    667
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Email Form Issues!!!

    Hello,

    I've created this landing page and the email form worked perfectly on one server, works well here...

    www.modocom.ca/wansonlumber

    But when uploaded the files and everything to the Wanson Lumber server it doesnt send it goes to the Error page, how can I resolve this, the client is asking what Mail Server am I using as they do not allow emails to send out or something like that their firewall doesnt allow it. Here is the Wanson Lumber page...

    www.wansonlumber.com

    Thanks,

    Mike

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,343
    Mentioned
    192 Post(s)
    Tagged
    4 Thread(s)
    What is the contents of `contactengine.php` ?
    Post the source code here (in proper `code` tags) and we can help you.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    667
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Here is the code...

    PHP Code:
    <?php

    $EmailFrom 
    Trim(stripslashes($_POST['Email']));
    $EmailTo "mbond5@gmail.com";
    $Subject "Wanson Lumber Email Form";
    $Name Trim(stripslashes($_POST['Name'])); 
    $Email Trim(stripslashes($_POST['Email'])); 
    $Message Trim(stripslashes($_POST['Message'])); 

    // validation
    $validationOK=true;
    if (!
    $validationOK) {
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
      exit;
    }

    // prepare email body text
    $Body "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "\n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "\n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "\n";

    // send email 
    $success mail($EmailTo$Subject$Body"From: <$EmailFrom>");

    // redirect to success page 
    if ($success){
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
    }
    else{
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
    }
    ?>

  4. #4
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    667
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Any ideas on why it works one place and not the other?

  5. #5
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,438
    Mentioned
    45 Post(s)
    Tagged
    13 Thread(s)
    First of all, have you checked the junk mail folder of the receiving account to see if the mail is being flagged as spam? Differences in the setup of the sending server can cause that sometimes.

    Secondly, what is the hosting situation of the website? You mention the client's firewall possibly being a problem - does that mean that they are hosting the site from their own server rather than a hosting company?

  6. #6
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    667
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    They are using their own server called SEDNA. He made it so can send emails but still couldnt. Not going to the Junk Mail thing, is when I submit it goes to the Error page on the www.wansonlumber.com website but not on the www.modocom.ca/wansonlumber is this something I can solve or is it on their end?

    Thanks

  7. #7
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,438
    Mentioned
    45 Post(s)
    Tagged
    13 Thread(s)
    I would try to check the log for whatever program is responsible for sending the email for PHP. On linux-based servers this is often sendmail, so you could try checking the log (see here for possible sendmail log locations) and seeing if there's an error msg that might throw some more light on the problem.

  8. #8
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    667
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is this something I would be doing as I'm not sure what program or server type they are using all they supplied me with is FTP information.

  9. #9
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,438
    Mentioned
    45 Post(s)
    Tagged
    13 Thread(s)
    Your code looks OK to me, and it obviously works for you in your test environment. It seems that the problem could well be with the server email setup. At the very least, that would be the next place to look to try and solve the problem. If you don't have access to the server (other than via FTP) then it's difficult for you to do much else.

  10. #10
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    667
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ok, I've contact them letting them know this that theres not much I could do from here on out. I believe its Windows based on not Linux if I can recall.

    Thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •