1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Perl not sending out email

Discussion in 'Software Development' started by Nigelum, Feb 18, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. Nigelum

    Nigelum Thread Starter

    Joined:
    Jan 20, 2003
    Messages:
    84
    Hello everyone,

    I recently created a contact form on my website using Perl / CGI to handle the information. I have a custom "error" page if the individual forgets to input certain informatoni, a "results" page that show information entered and a "behind-th-scenes" portion of my script that will send me email with the informationi that was provided. The "error" page and the "results" page work perfectly, but I'm not getting any eamil. Below is a copy of the eamil portion of my script.

    if ([$yes] eq "yes") {

    $recip = "wimerinc\@yahoo.com" ;

    open (MAIL, "|$mail_prog -t");
    print MAIL "To: $recip\n";
    print MAIL "Reply-to: $Contact_FirstName\n";
    print MAIL "From: $Contact_FirstName\n";
    print MAIL "Subject: Hey...someone has just filled out your contact form\n";
    print MAIL "\n\n";
    print MAIL "Robert\n" ;
    print MAIL "\n" ;
    print MAIL "Someone has just filled out your contact form on your website.\n" ;
    print MAIL "\n" ;
    print MAIL "----------------- information submitted -----------------\n" ;
    print MAIL "First name: ".$Contact_FirstName."\n" ;
    print MAIL "Last name: ".$Contact_LastName."\n" ;
    print MAIL "Middle Initial: ".$Contact_MiddleInitial."\n" ;
    print MAIL "Address".$Contact_StreetAddress."\n" ;
    print MAIL "Address: ".$Contact_Address2."\n" ;
    print MAIL "City: ".$Contact_City."\n" ;
    print MAIL "State: ".$Contact_State."\n" ;
    print MAIL "Zip: ".$Contact_ZipCode."\n" ;
    print MAIL "Country: ".$Contact_Country."\n" ;
    print MAIL "Home phone: ".$Contact_HomePhone."\n" ;
    print MAIL "FAX: ".$Contact_FAX."\n" ;
    print MAIL "Email: ".$Contact_Email."\n" ;
    print MAIL "Website: ".$Contact_URL."\n" ;
    print MAIL "\n" ;
    print MAIL "Comments: ".$comments."\n" ;
    print MAIL "\n\n";
    close (MAIL);

    }

    Since I dont know too much about creating these things, I use "Perl Builder" and use "Abyss web server pro". Active Perl has been installed on my server (I'm hosting my own site with a dedicated server), and I have configured my web server properly to handle the scripts.

    I have used this program before, but while my site has been hosted by someone else, but the code was the same. Remember, if you see any errors, please "hold my hand" through the fix-it process...I'm still learning.

    Please help
     
  2. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    Do you have a mail server running?
     
  3. Nigelum

    Nigelum Thread Starter

    Joined:
    Jan 20, 2003
    Messages:
    84
    I'm running the SMTP that comes with XP Pro and it seems to be doing fine. I wonder if I could get away with downloading another eamil server...any suggestions (free is nice)?
     
  4. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    What do you have $mail_prog set to?
     
  5. Nigelum

    Nigelum Thread Starter

    Joined:
    Jan 20, 2003
    Messages:
    84
    Haven't check this in a while...sorry

    jiml8....I don't have the $mail_prog set to anything. Keep in mind that I'm hosting my site for the first time and usually I uploaded the script when it was hosted by someone else...I'm a bit unfamiliar with the server side of things.

    I'm using a program called "Mail Enable" as my mail server. If instructions could be provided in proper code, that would be cool. I can always switch back to the SMTP mail included with Windows XP Pro. I'm using Abyss Web Server Pro as my server (IIS is disabled).

    Here is an updated version of the mail portion of my script:

    if ($Contact = "ON") {


    $recip = $Contact_Email ;

    open (MAIL, "|mail\Mail Enable\Bin\ -t");
    print MAIL "To: $recip\n";
    print MAIL "Reply-to: nigelum\@hotmail.com\n";
    print MAIL "From: Robert D. Wimer\n";
    print MAIL "Subject: Thanks...from Robert D. Wimer \@ www.robertwimer.com\n";
    print MAIL "\n\n";
    print MAIL "".$Contact_FirstName." ".$Contact_LastName."\n" ;
    print MAIL "\n" ;
    print MAIL "I have recieved your request and I\'ll get back to you as soon as possible.\n" ;
    print MAIL "\n" ;
    print MAIL "Robert D. Wimer\n" ;
    print MAIL "\n" ;
    print MAIL "-------------------------- information --------------------------\n" ;
    print MAIL "\n" ;
    print MAIL "".$Contact_FirstName."\n" ;
    print MAIL "".$Contact_LastName."\n" ;
    print MAIL "".$Contact_MiddleInitial."\n" ;
    print MAIL "".$Contact_StreetAddress."\n" ;
    print MAIL "".$Contact_Address2."\n" ;
    print MAIL "".$Contact_City."\n" ;
    print MAIL "".$Contact_State."\n" ;
    print MAIL "".$Contact_ZipCode."\n" ;
    print MAIL "".$Contact_Country."\n" ;
    print MAIL "".$Contact_HomePhone."\n" ;
    print MAIL "".$Contact_FAX."\n" ;
    print MAIL "".$Contact_Email."\n" ;
    print MAIL "".$Contact_URL."\n" ;
    print MAIL "".$comments."\n" ;
    print MAIL "\n\n";
    close (MAIL);

    }


    if ($Submit = "Submit") {

    $recip = "nigelum\@hotmail.com" ;

    open (MAIL, "|mail\Mail Enable\Bin\ -t");
    print MAIL "To: $recip\n";
    print MAIL "Reply-to: $Contact_Email\n";
    print MAIL "From: $Contact_Email\n";
    print MAIL "Subject: someone has filled out your form\n";
    print MAIL "\n\n";
    print MAIL "".$Contact_FirstName." ".$Contact_LastName." at ".$Contact_StreetAddress." ".$Contact_City.", ".$Contact_State." ".$Contact_ZipCode."\n" ;
    print MAIL "has requested you contact them. below is the contact information.\n" ;
    print MAIL "\n" ;
    print MAIL "".$Contact_HomePhone."\n" ;
    print MAIL "".$Contact_FAX."\n" ;
    print MAIL "".$Contact_Email."\n" ;
    print MAIL "".$Contact_URL."\n" ;
    print MAIL "".$comments."\n" ;
    print MAIL "".$contact."\n" ;
    print MAIL "\n\n";
    close (MAIL);

    }

    I know I have to declare my mail client, but I don't know how.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/443619

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice