Главная страница


ru.cgi.perl

 
 - RU.CGI.PERL ------------------------------------------------------------------
 From : Serg Demchuk                         2:5020/400     08 Oct 2006  11:39:46
 To : Artem Chuprina
 Subject : Re: Отправка почты
 -------------------------------------------------------------------------------- 
 
  AC> From: Artem Chuprina <ran+news@ran.pp.ru>
 
   SD>>>>      Content      => [
  SD>>>                        to =>> 'ppp@rambler.ru',
  SD>>>                        subject =>> 'Test',
  SD>>>                        attach =>> '"D:\fffg.arj"',
  SD>>>                        text =>> 'Привет',
  SD>>>>                        save_sent => 'checked',
  SD>>>                        submit =>> 'Отправить письмо'
  SD>>>>                      ];
  SD>>>> my $res = $browser->request($send_req);
 
  SG>>> но в данном куске кода я не вижу чтения файла с диска и передачи его
  SG>>> содержимого с запросом.
 
  TP>>     Этим занимается LWP.
 
  а как мне тогда передать его содержмое
 читаю файл так:
 $req = HTTP::Request->;new(GET => 'file:///D:/fffg.arj');
 
 $req->content_type('application/octet-stream');
 
 $response = $ua->request($request);
 
 когда посмотрел ethereal-ом как выглядит отправляемый запрос (как мне такое
 сделать?):
 
 ------------w3X4S7zJNKfaM1zubddFxj
 Content-Disposition: form-data; name="attach"; filename="ty.pl"
 Content-Type: application/octet-stream
 
 use HTTP::Request;
 use LWP::UserAgent;
 $ua = LWP::UserAgent->new;
 $req = HTTP::Request->;new(GET => 'file:///D:/fffg.arj');
 
 $req->content_type('application/octet-stream');
 
 $response = $ua->request($request);
 $res=$response->content;
 open(F,">D:\f1.html");
 print F $res;
 close(F);
 
 ------------w3X4S7zJNKfaM1zubddFxj
 
 --- ifmail v.2.15dev5.3
  * Origin: FidoNet Online - http://www.fido-online.com (2:5020/400)
 
 

Вернуться к списку тем, сортированных по:

 Тема:    Автор:    Дата:  
 Отправка почты   Serg Demchuk   02 Oct 2006 13:27:52 
 Re: Отправка почты   Artem Chuprina   03 Oct 2006 01:00:03 
 Re: Отправка почты   Sergey Gernichenko   03 Oct 2006 12:58:50 
 Отправка почты   Tolik Piskov   06 Oct 2006 22:37:22 
 Re: Отправка почты   Artem Chuprina   07 Oct 2006 02:47:15 
 Re: Отправка почты   Serg Demchuk   08 Oct 2006 11:39:46 
 Re: Отправка почты   Sergey Gernichenko   08 Oct 2006 19:24:38 
 Re: Отправка почты   Serg Demchuk   09 Oct 2006 14:42:11 
 Отправка почты   Oleg Gromov   10 Oct 2006 09:20:42 
 Отправка почты   Serg Demchuk   10 Oct 2006 11:21:55 
 Отправка почты   Serg Chervjakov   03 Oct 2006 14:42:18 
Архивное /ru.cgi.perl/16679110dc92d.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional