#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    68
    Rep Power
    3

    Problem with sending email


    hi guys, i used many different codes but no one worked for me. can anyone give me any idea how can i do it??

    thanks

    Code:
    use Mail::Sendmail;  sendmail
    (     
    From    => 'mail1.bskyb.com',     
    To      => 'myemail@hotmail.com',     
    Subject => 'some subject',     
    Message => "body of the message", 
    );


    Code:
    use MIME::Lite;  
    my $msg = MIME::Lite->new
    (    
     From    => 'me@myhost.com',     
    To      => 'you@yourhost.com',     
    Cc      => 'some@other.com, some@more.com',     
    Subject => 'A message with 2 parts...',    
    Type    => 'multipart/mixed', 
    );  
    $msg->attach(     
    Type     => 'TEXT',     
    Data     => "Here's the GIF file you wanted", 
    );  
    $msg->attach(     
    Type     => 'image/gif',     
    Path     => 'aaa000123.gif',     
    Filename => 'logo.gif', ); 
     $msg->send;


    Code:
    #!/usr/bin/perl   
    use strict; 
     use warnings;  
    use MIME::Lite::TT::HTML;   
    my %params;   
    $params{first_name} = 'Frank';  
    $params{last_name}  = 'Wiles';  
    $params{amt_due}    = '24.99';   
    my %options;  
    $options{INCLUDE_PATH} = '/path/to/templates';   
    my $msg = MIME::Lite::TT::HTML->new(             
    From        =>  'admin@example.com',             
    To          =>  'frank@example.com',            
    Subject     =>  'Your recent purchase',            
    TmplOptions =>  \%options,             
    TmplParams  =>  \%params,  );   
    $msg->send;
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    What errors are you getting?

    Can you use "sendmail" from the command line?

    If not, you'll need to fix that first, or use a module that speaks SMTP. I've had success with Mail::Transport::SMTP.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

IMN logo majestic logo threadwatch logo seochat tools logo