7 comment

  1. Hi , I have a problem when I send a long string used Data=>$content, $content included \r\n , It can not sent all the content of $content . could you please tell me what the problem is ?

  2. Hi,
    I’ve got this error message:
    SMTP Failed to connect to mail server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
    at C:/EclipseWorkspaces/csse120/Perl_testy/Tk_hello_world.pl line 29

    Here is code:

    use MIME::Lite;
    
    $user = [email protected]';
    $pass = 'xxxxxxxxxx';
    print "$user\n";
    print "$pass\n";
    MIME::Lite->send('smtp', 'smtp.gmail.com', 
    	AuthUser=>$user, AuthPass=>$pass, Timeout=>10);
    # AuthUser=>$user, AuthPass=>$pass);
    
    
    my $MailFrom = [email protected]';
    my $to_list  = [email protected]';
    my $cc_list  = [email protected]';
    my $subject  = "hello test";
    my $message  = "This email was generated automatically.";
    
    my $msg = MIME::Lite->new(
        From     => $MailFrom,
        To       => $to_list,
        Cc       => $cc_list,
        Subject  => $subject,
        Type     => 'TEXT',
        Encoding => '7bit',
        Data     => $message,
    );
    print "I\'m sending message\.\.\.\n";
    print $msg;
    $msg->send();
    

    Could you help me please?

    Jan

Leave a Comment