The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]




Версия для распечатки Пред. тема | След. тема
Новые ответы [ Отслеживать ]
отправка файлов, !*! DenisK, 28-Июл-05, 13:15  [смотреть все]
Добрый день!
Можно ли в перл организовать передачу файла по почте?
  • отправка файлов, !*! levsha, 13:53 , 28-Июл-05 (1)
    >Можно ли в перл организовать передачу файла по почте?

    perldoc -q send mail

    • отправка файлов, !*! DenisK, 14:51 , 28-Июл-05 (2)
      >>Можно ли в перл организовать передачу файла по почте?
      >
      >perldoc -q send mail

      Ну и....?

      • отправка файлов, !*! allez, 15:01 , 28-Июл-05 (3)
        >Ну и....?

        Ну и читайте:
        ==========================================================================
        Found in /usr/lib/perl5/5.8.5/pod/perlfaq9.pod
               How do I send mail?

               Use the "sendmail" program directly:

                   open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
                                       or die "Can't fork for sendmail: $!\n";
                   print SENDMAIL <<"EOF";
                   From: User Originating Mail <me\@host>
                   To: Final Destination <you\@otherhost>
                   Subject: A relevant subject line

                   Body of the message goes here after the blank line
                   in as many lines as you like.
                   EOF
                   close(SENDMAIL)     or warn "sendmail didn't close nicely";

               The -oi option prevents sendmail from interpreting a line consisting of a single dot as
               "end of message".  The -t option says to use the headers to decide who to send the message
               to, and -odq says to put the message into the queue.  This last option means your message
               won't be immediately delivered, so leave it out if you want immediate delivery.

               Alternate, less convenient approaches include calling mail (sometimes called mailx)
               directly or simply opening up port 25 have having an intimate conversation between just
               you and the remote SMTP daemon, probably sendmail.

               Or you might be able use the CPAN module Mail::Mailer:

                   use Mail::Mailer;

                   $mailer = Mail::Mailer->new();
                   $mailer->open({ From    => $from_address,
                                   To      => $to_address,
                                   Subject => $subject,
                                 })
                       or die "Can't open: $!\n";
                   print $mailer $body;
                   $mailer->close();

               The Mail::Internet module uses Net::SMTP which is less Unix-centric than Mail::Mailer, but
               less reliable.  Avoid raw SMTP commands.  There are many reasons to use a mail transport
               agent like sendmail.  These include queuing, MX records, and security.
        ==========================================================================

        А я для передачи писем с вложениями пользуюсь модулем MIME::Lite.

    • отправка файлов, !*! DenisK, 08:11 , 29-Июл-05 (7)
      >>Можно ли в перл организовать передачу файла по почте?
      >
      >perldoc -q send mail

      ВСЕМ спасибо!
      воспользовался MIME::Lite

  • отправка файлов, !*! mthawk, 17:00 , 28-Июл-05 (5)
    >Добрый день!
    >Можно ли в перл организовать передачу файла по почте?


    http://search.cpan.org/~yves/MIME-Lite-3.01/lib/MIME/Lite.pm

  • отправка файлов, !*! chip, 07:57 , 29-Июл-05 (6)
    >Добрый день!
    >Можно ли в перл организовать передачу файла по почте?

    http://search.cpan.org/~gbarr/libnet-1.19/Net/SMTP.pm




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру