e-mail won't work

My e-mail function won't work. What am I missing?

      while($n > 0){
      $card = "2142000".$n.".html";
      if(-e "../valentine/cards/$card"){
      print "$card is being used.";
      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";
      $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";
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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";

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kch011099Author Commented:
I just needed the \n
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.