www.webdeveloper.com
Results 1 to 5 of 5

Thread: Automatic mail !!?

  1. #1
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    146

    Automatic mail !!?

    Hi, i ve a guestbook...and i would like that the man ho leaves a message gets a mail in his mail box..i ve donne something but it does not work...i ve already done that I get a mail when a message is posst ...but I think the two things are confused !!??
    her is the code !!! actually simple but....

    the problem is in the second part caus without it it works !!! duhhh )


    # Option Mail

    if ($mail eq '1') {
    open (MAIL, "|$mailprog $mailto") || die "Can't open $mailprog!\n";
    print MAIL "Reply-to: $FORM{'email'} ($FORM{'name'})\n";
    print MAIL "From: $FORM{'email'} ($FORM{'name'})\n";
    print MAIL "Subject: Entry to YOUR Guestbook\n\n";
    print MAIL "$FORM{'name'} <$FORM{'email'}> has made an entry to your guestbook!\n";
    print MAIL "Comments :\n $FORM{'comments'}\n";
    print MAIL " - $date\n";
    close (MAIL);
    }
    if ($mail eq '1') {
    open (MAIL2, "|$mailprog $FORM{'email'}") || die "Can't open $mailprog!\n";
    print MAIL2 "Reply-to: mail@mailxxxx\n";
    print MAIL2 "From: mail@mailxxxx\n";
    print MAIL2 "Subject: XXXXXXX - Guestbook\n\n";
    print MAIL2 "$FORM{'name'},\nThank you for visiting our website and leaving a message...\n;
    print MAIL2 " - $date\n";
    close (MAIL2);
    }

    I dont think I can do 2 "if" but how should I do it then )..

    hope you can help me...thanks

  2. #2
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    Although it is hard to say since you didn't say specifically what doesn't work or any error messages you get, I'd bet it's these two lines that are messing your up:
    Code:
    print MAIL2 "Reply-to: mail@mailxxxx\n";
    print MAIL2 "From: mail@mailxxxx\n";
    because the @mailxxxx is being interpreted as an interpolated array. Add a backslash before the @ character.
    Code:
    print MAIL2 "Reply-to: mail\@mailxxxx\n";
    print MAIL2 "From: mail\@mailxxxx\n";

  3. #3
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    146
    Hi, i ve put a backslash but the error is stil ther !!! it sais :

    Internal server error !!
    bad configuration...

    I think MAIL and MAIL2 are bringing to confusion is it possible to bring it all in one loop !! duhhh )

    thanks

  4. #4
    celebguy_dv Guest

  5. #5
    celebguy_dv Guest

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles