Thread: CGI Mail Script

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Wheaton,IL USA
    Posts
    9
    Rep Power
    0
    Hello,
    I've created a mail script, but I can't figure out how to put my $email variable into the FROM field of the email. This is the code I have now:

    open (MAIL, "|$mailprog -t") or &dienice("Can't access $mailprog!n");

    print MAIL "To: $recipientn";

    print MAIL "From: $emailn";

    I know it's probably a simple fix, and I appreciate the help.
    Thanks,
    Jamie
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>I can't figure out how to put my $email variable into the FROM field of the email.

    How do you get $email? If it's predefined in your script like this:

    $email = "whoopnstik@aol.com";
    Then you need to escape the @ char like so:

    $email = "whoopnstik@aol.com";

    With single quotes, you don't need to.
    $email = 'whoopnstik@aol.com';

IMN logo majestic logo threadwatch logo seochat tools logo