No SMTP message



  • use CGI::Carp qw(fatalsToBrowser);
    use CGI qw(:standard);
    use Net::SMTP;
    
    print "Content-type: text/html \n\n";
    
    $smtp= Net::SMTP->new('smtp.mail.ru') ;
    
    $smtp->auth('log','pass');
    
    $smtp->mail("from@mail.ru");
    $smtp->to("to@mail.ru");
    $smtp->data();
    $smtp->datasend("To: to@mail.ru");
    $smtp->datasend("From: from@mail.ru");
    $smtp->datasend('Subject: tema1 \r\n');
    $smtp->datasend("\r\n");
    $smtp->datasend("HELLO WORLD. \r\n");
    print $smtp->message();
    $smtp->dataend();
    
    $smtp->quit();
    


  • The thing is, you're using double-cross for the lines that contain a special symbol @.

    It's a symbol.

    $smtp->mail("from\@mail.ru"); 
    $smtp->to("to\@mail.ru"); 
    $smtp->data(); 
    $smtp->datasend("To: to\@mail.ru"); 
    $smtp->datasend("From: from\@mail.ru");
    

    Either use the one-sided quotes:

    $smtp->mail('from@mail.ru'); 
    $smtp->to('to@mail.ru'); 
    $smtp->data(); 
    $smtp->datasend('To: to@mail.ru'); 
    $smtp->datasend('From: from@mail.ru');
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2