Click here to Skip to main content
15,900,258 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Advice needed Pin
Marc Firth28-May-09 1:45
Marc Firth28-May-09 1:45 
AnswerRe: Advice needed Pin
Blue36528-May-09 1:24
Blue36528-May-09 1:24 
Questionlarge file uploading problem Pin
khushi171026-May-09 0:10
khushi171026-May-09 0:10 
AnswerRe: large file uploading problem Pin
Marc Firth26-May-09 21:59
Marc Firth26-May-09 21:59 
Newsa challenge to try to hack key Pin
haingoc1122-May-09 8:37
haingoc1122-May-09 8:37 
GeneralRe: a challenge to try to hack key Pin
EliottA22-May-09 8:51
EliottA22-May-09 8:51 
QuestionRe: a challenge to try to hack key Pin
Java John10-Jun-09 0:38
Java John10-Jun-09 0:38 
QuestionPhP Mail not going out-of-house mail server [modified] Pin
darantares22-May-09 7:54
darantares22-May-09 7:54 
Alright, I've created a PhP page that takes the data from a field and e-mails that data to a specified user. It also sends a conformation e-mail to the person who filled in the form.

The problem is I can not get it to work when either the specified user or the person filling out the form is from an out of house e-mail address (I'm at a business).

I know the code works because I can move the page to my personal server and it works with any e-mail addresses, no problem.

Naturally, I figure it's a setting in PhP on the server that is stopping the outgoing mail. But, I do not have access to the PhP settings to change them - its a large business, and one guy alone does the PhP setting stuff. I want to try to get this to work without having to change a setting in the PhP.

I've heard about work around scripts to get this to work. Any ideas/input would be greatly appreciated.

<?php     

      $email = $_POST["emailaddress"]; // defines user email address from previous page
      $mailto = "me@mywebsite.com";   // person who gets the information in the email
      $d = getdate();
      $t = gettimeofday();
      $mailsubj = "Information";
      $mailhead = "From: $email\n";
      reset ($HTTP_POST_VARS);
  
      $status = true;
      $errorStatement = "";     


?>

<table width="600" height="500" border="0" cellpadding="0" cellspacing="0">
      <tr>
            <td valign="top" class="boxtext">
                        <?
                    
            // data validation (required fields)
                        if ( empty( $_POST[ 'Name' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - Name<br>";
                        }                                         
                                            
                        if ( empty( $_POST[ 'Address' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - Address<br>";
                        }

                        if ( empty( $_POST[ 'City' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - City<br>";
                        }

                        if ( empty( $_POST[ 'State' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - State<br>";
                        }

                        if ( empty( $_POST[ 'Zip' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - Zipcode<br>";
                        }
                    
                        if ( empty( $_POST[ 'Phone' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - Phone Number<br>";
                        }
                    
                        if ( empty( $_POST[ 'AltPhone' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - Alternate Phone Number<br>";
                        }
                    
                        if ( empty( $_POST[ 'emailaddress' ] ) ) {
                                 $status = false;
                              $errorStatement .= "      - Email Address<br>";
                        }

                        // end data verification

                        if ( $status == false ) {
                              print( "<br>Invalid Submission<br><br>" );
                              print( "The following item(s) are missing or incorrect:<br>" );
                              print ( $errorStatement );
                              print( "<br>Please click your browser's back button and reenter the missing data.<br>" );
                        }

                        else
                              if ( ( isset( $_POST['Submit'] ) ) and ( $status = true ) ) {
                                    // create email
                                    $mailbody = "Information\n\nDate of Submission: $d[mon]/$d[mday]/$d[year]\nTime of Submission: $d[hours]:$d[minutes]\n\n";
                                    while (list ($key, $val) = each ($HTTP_POST_VARS)) {
                                          $mailbody .= "$key : $val\n";
                                    }

                                    $mailsubj .= " - ";
                                    $mailsubj .= $_POST[ 'Name' ];
                                
                                    // send back page with information to user
                                    $usersubject = "Thank You";
                                    $userheaders = "From: me@mywebsite.com\n";
                                    $usermessage = "Congratulations!";

                                                                        \\mails the data to the user specified
                                    mail($mailto, $mailsubj, $mailbody, $mailhead);  
                                   
                                                                        \\mails a conformation email to the address put in the field
                                    mail($email, $usersubject, $usermessage, $userheaders);
                                
                                    print( "Thank you for submitting your information. You will receive a conformation e-mail shortly with the information
                                    you just sent. <br><br>\n" );
                                    print( "Here is the information you provided:<br><br>\n" );
                        ?>

modified on Sunday, May 24, 2009 9:33 PM

AnswerRe: PhP Mail not going out-of-house mail server Pin
Marc Firth26-May-09 21:50
Marc Firth26-May-09 21:50 
QuestionFile Transfer using Perl Pin
Anand Jaiteertha22-May-09 0:31
Anand Jaiteertha22-May-09 0:31 
AnswerRe: File Transfer using Perl Pin
jschell22-May-09 7:13
jschell22-May-09 7:13 
GeneralRe: File Transfer using Perl Pin
Anand Jaiteertha22-May-09 20:13
Anand Jaiteertha22-May-09 20:13 
GeneralRe: File Transfer using Perl Pin
Randor 6-Jun-09 9:36
professional Randor 6-Jun-09 9:36 
AnswerRe: File Transfer using Perl Pin
TiGuCo6-Jul-09 6:26
TiGuCo6-Jul-09 6:26 
QuestionGnome window resize not working Pin
Divyang Mithaiwala19-May-09 1:25
Divyang Mithaiwala19-May-09 1:25 
AnswerRe: Gnome window resize not working Pin
Moreno Airoldi29-May-09 7:30
Moreno Airoldi29-May-09 7:30 
QuestionRE: how to run C++ code on linux Pin
savitha87k17-May-09 20:11
savitha87k17-May-09 20:11 
QuestionRe: RE: how to run C++ code on linux Pin
Divyang Mithaiwala19-May-09 1:29
Divyang Mithaiwala19-May-09 1:29 
AnswerRe: RE: how to run C++ code on linux Pin
savitha87k19-May-09 17:02
savitha87k19-May-09 17:02 
GeneralRe: RE: how to run C++ code on linux Pin
Sebastian Schneider22-May-09 1:15
Sebastian Schneider22-May-09 1:15 
GeneralRe: RE: how to run C++ code on linux Pin
N a v a n e e t h1-Jun-09 0:56
N a v a n e e t h1-Jun-09 0:56 
GeneralRe: RE: how to run C++ code on linux Pin
cludwig14620-Jun-09 6:07
cludwig14620-Jun-09 6:07 
QuestionCombining Command Lines Pin
See_Sharp15-May-09 20:17
See_Sharp15-May-09 20:17 
Answerone way to do it Pin
Jimmanuel16-May-09 0:55
Jimmanuel16-May-09 0:55 
Questioncommands not working if the executed from forked process Pin
shekharban11-May-09 21:23
shekharban11-May-09 21:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.