e-mail won't work

My e-mail function won't work. What am I missing?
---------------------------------------
      $n=1;

      while($n > 0){
                                    $n++;
      $card = "2142000".$n.".html";
      if(-e "../valentine/cards/$card"){
      print "$card is being used.";
        }
      else{
      open(NEWCARD, ">../valentine/cards/$card");
          print NEWCARD "<html><head><title>$to\'s Valentine Card</title></head><body bgcolor=\"#ffe4e1\">";
          print NEWCARD "<font color=black face=\"Arial, Helvetica\">";
          print NEWCARD "<font color=crimson face=\"Arial, Helvetica\">Here is your Valentine's Day card!</font>\n";
          print NEWCARD "<table width=100\% height=100\%><tr><td align=center valign=center>";
          print NEWCARD "<img src=\"http://www.dfasdfsd.com/valentine/$image\" border=0><br><br>";
          print NEWCARD "<font face=\"$font\" color=\"$fontcolor\">$to<br><br>$message<br><br>$salutation<br>$from</font>";
          print NEWCARD "</td></tr>";
          print NEWCARD "</table></body></html>";
          print "<B>Your card has been created!! The number is $card.</B>\n";
      close<NEWCARD>;
      $mailprog = '/usr/sbin/sendmail';
      open(MAIL, "|$mailprog -t");
      print MAIL "To: sadfd\@dsfdsf.com";
      print MAIL "From: dsaf\@daddf.com";
      print MAIL "Subject: A Valentine Card for You!";
      print MAIL "Pick up your Valentine at http://www.dfsasd.com/valentine/card/$card";
      close(MAIL);
      exit;}
      }
kch011099Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
guadalupeConnect With a Mentor Commented:
First are you sure that sendmail is in:

/usr/sbin/sendmail  and not /usr/bin/senmail

The also put \n at the en of the lines To,From,Subject  like this:

");
      print MAIL "To: sadfd\@dsfdsf.com\n";
      print MAIL "From: dsaf\@daddf.com\n";
      print MAIL "Subject: A Valentine Card for You!\n";
       
0
 
kch011099Author Commented:
I just needed the \n
Thanks!
0
All Courses

From novice to tech pro — start learning today.