Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi Everyone, I need help too. My code use to work with Verizon (changed providers) but it does not work when I use my own domain. The settings work with my website on the same computer using php so I know the domain and password are valid. This is my error message:
Can't call method "auth" on an undefined value at send_mail.pm line 31.

Can someone please help?

Small perl test script below

#!/usr/bin/perl require "send_mail.pm"; $title = "my title"; $desc = 'my desc'; $link = 'http://www.google.com'; $epoch = 1287629117; $file_name = 'file.txt'; $input[2] = 'kevin@mydomain.net'; &send_mail::send_email ($title, $desc, $link, $epoch, $file_name, \$$i +nput[2]);
Function below
package send_mail; sub send_email (){ my ($title, $desc, $link, $epoch, $name, $emails) = @_; use POSIX qw(strftime); my $est = strftime "%a, %B %d, %Y, %X %z", localtime($epoch); my $smtp = Net::SMTP->new('mail.mydomain.net', LocalAddr => 2626, Timeout => 10, Debug => 1 ); $smtp->auth( 'kevin@mydomain.net', 'password'); $smtp->mail('kevin@mydomain.net'); # use the sender's adress here my @em = split (',',$$emails); foreach (@em){ $smtp->to($_); # recipient's address } $smtp->data(); # Start the mail $smtp->datasend("Subject: " . $title); $smtp->datasend("\n" . $desc . "\n" . $link . "\nListing time: " . $ +est ); $smtp->datasend("\n\n bunch of text here " . $name); $smtp->dataend(); # Finish sending the mail $smtp->quit; # Close the SMTP connection }

In reply to Re^2: Net::SMTP_auth by Anonymous Monk
in thread Net::SMTP_auth by projekt21

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-29 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found