SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: PHP Error

  1. #1
    SitePoint Enthusiast turkey's Avatar
    Join Date
    May 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow PHP Error

    Hey everyone,

    Im quite new to PHP so I decided to find a few tutorials on how to make a php form. So I basically follow one from tutvid.com and all goes well until I get this error below when its submitted:

    Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\Hosting\3853370\html\scripts\contactme_script.php on line 22


    I believe that the line in question is:
    $success = mail($webMaster, $emailSubject, $body, $headers);

    Any help would be appreciated. Thanks

    Here is the code below:
    PHP Code:
    <?php

    // Function to check spam
    function checkforspam() {
       
    $problem 'N';
       foreach (
    $_POST as $key => $value) {
         if (
    stristr($value,'Content-Type:') || stristr($value,'bcc:')) {
           
    $problem 'Y';
         }
       }
       if (
    $problem == 'Y') {
         return 
    'Y';
       } else {
         return 
    'N';
       }


    /* Subject and Email Variables */

        
    $emailSubject 'Feedback from Contact Me Page';
        
    $webMaster  'ara@arakhomes.com';
        
        
    /*Gathering Data Variables*/

            
        
    $body = <<<EOD
    <strong>Name:</strong><br> $name <br><br><hr><br>
    <strong>City:</strong><br> 
    $city <br><br><hr><br>
    <strong>State:</strong><br> 
    $state <br><br><hr><br>
    <strong>Email:</strong><br> 
    $email <br><br><hr><br>
    <strong>Comments:</strong><br> 
    $comments <br><br>
    EOD;

        
    $headers "From: $email\r\n";
        
    $headers .= "Content-type: text/html\r\n";
        
    $success mail($webMaster$emailSubject$body$headers);
        
        
    /* Results Rendered as HTML */
        
    $theResults = <<<EOD
    <html>
    <head>
    <title>Ara K Homes - Thank You for Contacting Us!</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="../ara_css.css" rel="stylesheet" type="text/css">
    </head><body>
    <table width="562" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="3"><img src="../images/banner.jpg" width="760" height="91"></td>
      </tr>
      <tr>
        <td colspan="3" valign="middle" background="../images/nav_pat.jpg" style="background-repeat:repeat-x"></td>
      </tr>
      
      <tr>
        <td height="249" colspan="3" valign="top" bgcolor="#152330" style="background-repeat:repeat-x"><table width="562" border="0" align="center" cellpadding="0" cellspacing="0" id="info">
          <tr>
            <td height="249" align="center" valign="middle"><span class="smtitlebw_16px">Thank You!</span><br>
                  <span class="white12px">Your feedback has been submitted successfully!</span><br />
                    <p class="white11px"><a href="../index.html"><strong>Return to Homepage</strong></a></p></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td width="25" valign="top" style="background-repeat:repeat-x"><img src="../images/footr_left.jpg" alt="ftrlft" width="25" height="36" /></td>
        <td width="710" align="center" valign="middle" background="../images/footer_pat.jpg" class="text_creme_caps11px" style="background-repeat:repeat-x">Copyright 2009 
          &copy; Ara Karapetian | CCIM. All Rights Reserved</td>
        <td width="25" valign="top" style="background-repeat:repeat-x"><img src="../images/footr_rgt.jpg" alt="rightftr" width="25" height="36" /></td>
      </tr>
    </table>
    </body>
    </html>
    EOD;
    echo 
    "$theResults";

    ?>

  2. #2
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see a value for $email in your From header.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2009
    Location
    South Florida
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is your PHP pointing to email server in windows correctly?

    Did you setup your email accounts in windows server?

    Can you send any email from local email server directly?

  4. #4
    SitePoint Enthusiast turkey's Avatar
    Join Date
    May 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the webhost that im on is Godaddy so maybe i'll look to see if theres any additional settings to check. Im not sure what you mean spiderling (unfortunately). I have used this script on another server and it worked so.


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
  •