CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 1999
    Posts
    505

    ProblemEmail::Send::Gmail; with

    Hi,
    I am trying to send emaiEmail::Send::Gmail;

    l have got following code from web:

    Code:
    #!/usr/bin/perl
      ##use strict;
      use warnings;
      use Email::Send;
      use Email::Send::Gmail;
      use Email::Simple::Creator;
    use IO::Socket::SSL qw( SSL_VERIFY_NONE );
    our ($uri);
    
    RPC::XML::Client->new($uri,
       useragent => [
          ssl_opts => {
             verify_hostname => 0,
             SSL_verify_mode => SSL_VERIFY_NONE,
          },
       ],
    );
    
      my $email = Email::Simple->create(
          header => [
              From    => 'zulfi60001@gmail.com',
              To      => 'zulfi60001@gmail.com',
              Subject => 'Server down',
          ],
          body => 'The server is down. Start panicing.',
      );
    
      my $sender = Email::Send->new(
          {   mailer      => 'Gmail',
              mailer_args => [
                  username => 'zulfi60001@gmail.com',
                  password => 'XXX',
              ]
          }
      );
      eval { $sender->send($email) };
      die "Error sending email: $@" if $@;
    I am getting following error:
    D:\Zulfi\PERL MAIN FOLDER>perl gmail2.pl
    Can't locate object method "new" via package "RPC::XML::Client" (perhaps you for
    got to load "RPC::XML::Client"?) at gmail2.pl line 10.

    D:\Zulfi\PERL MAIN FOLDER>
    Somebody plz help me.

    Zulfi.

  2. #2
    Join Date
    Jun 1999
    Posts
    505

    Re: ProblemEmail::Send::Gmail; with

    Hi,
    I have changed my code. The code is now:
    Code:
    #!/usr/bin/perl
      use strict;
      use warnings;
      use Email::Send;
      use Email::Send::Gmail;
      use Email::Simple::Creator;
      use RPC::XML::Server;
       use RPC::XML::Client;
        
        
    
        
    
    
    
    use IO::Socket::SSL qw( SSL_VERIFY_NONE );
    our ($uri);
    
    $cli=RPC::XML::Client->new($uri,
       useragent => [
          ssl_opts => {
             verify_hostname => 0,
             SSL_verify_mode => SSL_VERIFY_NONE,
          },
       ],
    );
    
      my $email = Email::Simple->create(
          header => [
              From    => 'zulfi60001@gmail.com',
              To      => 'zulfi60001@gmail.com',
              Subject => 'Server down',
          ],
          body => 'The server is down. Start panicing.',
      );
    
      my $sender = Email::Send->new(
          {   mailer      => 'Gmail',
              mailer_args => [
                  username => 'zulfi60001@gmail.com',
                  password => 'xxx',
              ]
          }
      );
      eval { $sender->send($email) };
      die "Error sending email: $@" if $@;
    D:\Zulfi\PERL MAIN FOLDER>perl gmail2_test.pl
    Global symbol "$cli" requires explicit package name at gmail2_test.pl line 19.
    Execution of gmail2_test.pl aborted due to compilation errors.

    D:\Zulfi\PERL MAIN FOLDER>
    Somebody plz help me with this prob.

    Zulfi.

  3. #3
    Join Date
    Jun 1999
    Posts
    505

    Re: ProblemEmail::Send::Gmail; with

    Hi,

    Finally I got help. I am able to send email through gmail smtp. I am putting the link
    http://perlguru.com/gforum.cgi?post=...=unread#unread

    Zulfi.

  4. #4
    Join Date
    Jun 1999
    Posts
    505

    Re: ProblemEmail::Send::Gmail; with

    Hi
    Plz translate it into English.

    Zulfi,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured