Mail-SpamCannibal

 view release on metacpan or  search on metacpan

lib/Mail/SpamCannibal/SMTPsend.pm  view on Meta::CPAN


=back

=cut

sub sendmessage {
  my ($message,$to,$from,$fh) = @_;
  $to .= '@' . fqdn()
	unless $to =~ /\@/;
  unless ($from) {
    $from = (getpwuid($<))[0] .'@'. fqdn();
  } elsif( $from !~ /\@/) {
    $from .= '@' . fqdn();
  }
  my $head = 'To: '. $to ."\nFrom: ". $from ."\n";
  my @mxhosts = getMXhosts($to);
  return 0 unless @mxhosts;

  my $smtp;
  foreach(@mxhosts) {
    $smtp = Net::SMTP::->new($_,Hello => fqdn());



( run in 0.288 second using v1.01-cache-2.11-cpan-8d75d55dd25 )