Ask a Question related to PERL Beginners, Design and Development.
-
John #1
connecting to a mail server via IMAP
Can perl connect to a mail server via imap and then send some emails (with attachements of course)
John Guest
-
#40420 [NEW]: --with-imap fails for imap-2004g from University of Washington IMAP toolkit
From: romanf at trash dot net Operating system: Suse Linux 10.0 64bit PHP version: 5.2.1 PHP Bug Type: Compile Failure Bug... -
Geting Mail Messages From IMAP to UNIX mail file ???
I need a solution to get messages from IMAP server transfered over to my server. Once the transfer complete I want to be able to read them. And one... -
moving mail to imap
Hey all.. I use mozilla mail for my email.. and (at the moment) I have about 15,000 emails in my "Local Folders".. they are all in... -
#24846 [Opn->Fbk]: IMAP Mail functions are extremely slow
ID: 24846 Updated by: wez@php.net Reported By: gremlinx at speed-city dot com -Status: Open +Status: ... -
#24846 [Opn]: IMAP Mail functions are extremely slow
ID: 24846 User updated by: gremlinx at speed-city dot com Reported By: gremlinx at speed-city dot com Status: Open... -
John #2
Re: connecting to a mail server via IMAP
Has perl its own smpt to send mails?
----- Original Message -----
From: "David le Blanc" <com.au>
To: "John" <uoi.gr>
Sent: Tuesday, February 17, 2004 1:25 PM
Subject: RE: connecting to a mail server via IMAP
John Guest
-
Rob #3
Re: connecting to a mail server via IMAP
John wrote:
John wrote:
Hi John.
You need Mail::IMAPClient and Net::SMTP.
HTH,
Rob
Rob Guest
-
John #4
Re: connecting to a mail server via IMAP
So, could we send attachments using the Mail::IMAPClient?
----- Original Message -----
From: "Rob Dixon" <port995.com>
To: <org>
Sent: Tuesday, February 17, 2004 2:41 PM
Subject: Re: connecting to a mail server via IMAP
>
> John wrote:
>
> Hi John.
>
> You need Mail::IMAPClient and Net::SMTP.
>
> HTH,
>
> Rob
>
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
John Guest
-
Rob #5
Re: connecting to a mail server via IMAP
John wrote:
> >
> > John wrote:
> >
> > Hi John.
> >
> > You need Mail::IMAPClient and Net::SMTP.[/ref]
>
> So, could we send attachments using the Mail::IMAPClient?[/ref]
Sorry John, I misread your first post. You can't use IMAP to send anything: it's
a mail access protocol. You need SMTP.
Rob
Rob Guest
-
John #6
Re: connecting to a mail server via IMAP
I tried to connect to an imap server via the sample script that
Mail::IMAPClient document provides and i recieved the following error.
Mail::IMAPClient not using Fast_IO; not available on this platform at
imap_test.pl line 15
----- Original Message -----
From: "John" <uoi.gr>
To: "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 2:56 PM
Subject: Re: connecting to a mail server via IMAP
> >
> > John wrote:
> >
> > Hi John.
> >
> > You need Mail::IMAPClient and Net::SMTP.
> >
> > HTH,
> >
> > Rob
> >
> >
> >
> > --
> > To unsubscribe, e-mail: org
> > For additional commands, e-mail: org
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
> >
> >
> >[/ref]
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
John Guest
-
John #7
Re: connecting to a mail server via IMAP
Using Net::SMTP can i send an email from my machine? Or Net::SMTP will
enable to me to connect to a mail server and send email with attachements?
----- Original Message -----
From: "Rob Dixon" <port995.com>
To: <org>
Sent: Tuesday, February 17, 2004 3:10 PM
Subject: Re: connecting to a mail server via IMAP
> >
> > So, could we send attachments using the Mail::IMAPClient?[/ref]
>
> Sorry John, I misread your first post. You can't use IMAP to send[/ref]
anything: it's
John Guest
-
Aman #8
RE: connecting to a mail server via IMAP
I don't think you can send attachments using Net::SMTP.
Use Mail::Sender by Jenda Krynicky....it works !
And what's best is that Jenda is always around in this list raring to
help...so u've got real time support ;-)
And yes you do indeed need a mail server to connect to...
Cheers
-aman
-----Original Message-----
From: John [mailto:uoi.gr]
Sent: 17 February 2004 18:54
To: Perl Beginners
Subject: Re: connecting to a mail server via IMAP
Using Net::SMTP can i send an email from my machine? Or Net::SMTP will
enable to me to connect to a mail server and send email with attachements?
----- Original Message -----
From: "Rob Dixon" <port995.com>
To: <org>
Sent: Tuesday, February 17, 2004 3:10 PM
Subject: Re: connecting to a mail server via IMAP
> >
> > So, could we send attachments using the Mail::IMAPClient?[/ref]
>
> Sorry John, I misread your first post. You can't use IMAP to send[/ref]
anything: it's
--
To unsubscribe, e-mail: org
For additional commands, e-mail: org
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Aman Guest
-
John #9
Re: connecting to a mail server via IMAP
Is it neseccary to authenticate the smtp host?
testing the first sample script i saw no results.
Where is the problem?
----- Original Message -----
From: "Thind, Aman" <co.in>
To: "'John'" <uoi.gr>
Cc: "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 3:42 PM
Subject: RE: connecting to a mail server via IMAP
> >
> > Sorry John, I misread your first post. You can't use IMAP to send[/ref]
> anything: it's
>
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
John Guest
-
Daniel #10
Re: connecting to a mail server via IMAP
--As of Tuesday, February 17, 2004 4:17 PM +0200, John is alleged to have
said:
It depends on the host. ;-)
We'll need more information than that... I assume you were trying to mail
to an address you can check, from an address you can check? If it got
through, there is no notification, and many errors would result in a bounce.
Otherwise, if we could see the code you tried we could help.
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
Daniel Guest
-
John #11
Re: connecting to a mail server via IMAP
Here is my code
#!/usr/bin/perl -w
use Mail::Sender;
$sender = new Mail::Sender({smtp => 'mymailserver', from =>
'john@mymailserver'});
$sender->MailFile({to => 'john2@mymailserver',
subject => 'Here is the file',
msg => "I'm sending you the list you wanted."});
john, john2 usernames exist on the mymailserver (it runs ESMTP Sendmail
8.9.3/8.9.3)
----- Original Message -----
From: "Daniel Staal" <net>
To: "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 4:47 PM
Subject: Re: connecting to a mail server via IMAP
>
> It depends on the host. ;-)
>
>
> We'll need more information than that... I assume you were trying to mail
> to an address you can check, from an address you can check? If it got
> through, there is no notification, and many errors would result in a[/ref]
bounce.
John Guest
-
Wiggins #12
Re: connecting to a mail server via IMAP
Please bottom post, this thread is impossible to follow now...
Let's back up a bit and understand the fundamentals before trying to
wrangle the world of e-mail.
SMTP allows us to transfer messages, messages have a header and a body.
An attachment is a specialized part of a body. Net::SMTP provides the
means to access the more raw portion of sending a message, aka
connecting to and talking with an SMTP server. There is not a built in
Perl SMTP server (as that isn't a language's job). Net::SMTP is the
most direct way to send a message, and one of the uglier ways. So you
can send a message with attachments using Net::SMTP, you just won't want
to because you will have to know how to build it, which isn't easy.
Therefore you should use any of the numerous modules from CPAN to handle
the message building for you, Mail::Sender is a good one that has been
suggested, there are also the MIME-Tools, and Mail::Message (this has a
steep learning curve), among tens of others.
As for your message about authenticating to use SMTP that depends on the
host and we can't tell you about its configuration, talk to the admin
about it. Net::SMTP does provide the 'auth' method for doing authentication.
On the other side there is the delivery and access of messages through a
server. IMAP is one of these protocols, POP is another, etc. There are
at least two modules for reading from an IMAP server, Mail::IMAPClient
and Mail::Box (Mail::Message is part of this distro). I see that you
have tried the IMAPClient module, the message you posted is a warning
not an error.
Check out http://search.cpan.org for mail modules, there are loads of them.
http://danconia.org
> >
> > Sorry John, I misread your first post. You can't use IMAP to send[/ref]
> anything: it's
>
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
Wiggins Guest
-
John #13
Re: connecting to a mail server via IMAP
Hello,
First of all i use perl for windows.
Well, i what i really want to do is the following
There is an SMTP Server
There is a File Keeper Server (unix)
There are some hosts (win32)
The program i want to be able to send an email from the SMTP server
attaching some files from the File Keepr Server.
All that process i want to be done by the program running on a win32 system.
----- Original Message -----
From: "Wiggins d Anconia" <org>
To: "John" <uoi.gr>; "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 5:08 PM
Subject: Re: connecting to a mail server via IMAP
[/ref]
attachements?
>
> Let's back up a bit and understand the fundamentals before trying to
> wrangle the world of e-mail.
>
> SMTP allows us to transfer messages, messages have a header and a body.
> An attachment is a specialized part of a body. Net::SMTP provides the
> means to access the more raw portion of sending a message, aka
> connecting to and talking with an SMTP server. There is not a built in
> Perl SMTP server (as that isn't a language's job). Net::SMTP is the
> most direct way to send a message, and one of the uglier ways. So you
> can send a message with attachments using Net::SMTP, you just won't want
> to because you will have to know how to build it, which isn't easy.
> Therefore you should use any of the numerous modules from CPAN to handle
> the message building for you, Mail::Sender is a good one that has been
> suggested, there are also the MIME-Tools, and Mail::Message (this has a
> steep learning curve), among tens of others.
>
> As for your message about authenticating to use SMTP that depends on the
> host and we can't tell you about its configuration, talk to the admin
> about it. Net::SMTP does provide the 'auth' method for doing[/ref]
authentication.
them.
> > anything: it's
> >
> >
> >
> > --
> > To unsubscribe, e-mail: org
> > For additional commands, e-mail: org
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
> >
> >
> >[/ref]
>
>[/ref]
John Guest
-
Daniel #14
Re: connecting to a mail server via IMAP
--As of Tuesday, February 17, 2004 4:58 PM +0200, John is alleged to have
said:
Thanks. ;-)
use strict;
Well, you are missing a 'send' call; Mail::Sender has several you can
choose from, depending on your needs.
By the way, as others pointed out Mail::Sender is very low-level. I would
suggest a higher level module here. MIME::Lite is highly regarded, and
often overlooked while searching...
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
Daniel Guest
-
John #15
Re: connecting to a mail server via IMAP
Unfortunately, MIME::Lite requires Sendmail on the host.
----- Original Message -----
From: "Daniel Staal" <net>
To: "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 5:26 PM
Subject: Re: connecting to a mail server via IMAP
>
> Thanks. ;-)
>
>
> use strict;
>
>
> Well, you are missing a 'send' call; Mail::Sender has several you can
> choose from, depending on your needs.
>
> By the way, as others pointed out Mail::Sender is very low-level. I would
> suggest a higher level module here. MIME::Lite is highly regarded, and
> often overlooked while searching...
>
> Daniel T. Staal
>
> ---------------------------------------------------------------
> This email copyright the author. Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes. This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ---------------------------------------------------------------
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
John Guest
-
Daniel #16
Re: connecting to a mail server via IMAP
--As of Tuesday, February 17, 2004 5:53 PM +0200, John is alleged to have
said:
--As for the rest, it is mine.
Actually, no. It just uses it by default... You can say:
$msg->send('smtp'); #Uses the default smtp server.
or:
$msg->send('smtp', 'host.com'); #Uses host.com.
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
Daniel Guest
-
John #17
Re: connecting to a mail server via IMAP
Things getting better :)
But what is the difference in Path and FileName in the attachment method?
----- Original Message -----
From: "Daniel Staal" <net>
To: "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 6:10 PM
Subject: Re: connecting to a mail server via IMAP
>
> --As for the rest, it is mine.
>
> Actually, no. It just uses it by default... You can say:
> $msg->send('smtp'); #Uses the default smtp server.
> or:
> $msg->send('smtp', 'host.com'); #Uses host.com.
>
> Daniel T. Staal
>
> ---------------------------------------------------------------
> This email copyright the author. Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes. This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ---------------------------------------------------------------
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
John Guest
-
Wiggins #18
Re: connecting to a mail server via IMAP
PLEASE, bottom post...
Path is the location of the file on the local file system, FileName is
used in the content-disposition header for providing a suggested name
for the file on the recipient's end which may or may not be used or even
seen depending on the client. See told you, you didn't want to wrangle
mail yourself :-)...
http://danconia.org
[/ref]
have
> >
> > --As for the rest, it is mine.
> >
> > Actually, no. It just uses it by default... You can say:
> > $msg->send('smtp'); #Uses the default smtp server.
> > or:
> > $msg->send('smtp', 'host.com'); #Uses host.com.
> >
> > Daniel T. Staal
> >
> > ---------------------------------------------------------------
> > This email copyright the author. Unless otherwise noted, you
> > are expressly allowed to retransmit, quote, or otherwise use
> > the contents for non-commercial purposes. This copyright will
> > expire 5 years after the author's death, or in 30 years,
> > whichever is longer, unless such a period is in excess of
> > local copyright law.
> > ---------------------------------------------------------------
> >
> > --
> > To unsubscribe, e-mail: org
> > For additional commands, e-mail: org
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
> >
> >
> >[/ref]
>
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
Wiggins Guest
-
Jenda #19
Re: connecting to a mail server via IMAP
From: Daniel Staal <net>
>
> Thanks. ;-)
>
>
> use strict;
>
>
> Well, you are missing a 'send' call; Mail::Sender has several you can
> choose from, depending on your needs.[/ref]
Actually not. The MailFile method does create and send the message,
no need for any further method calls.
The problem is that John did not check for errors.
The easiest way (IMHO) is to ask Mail::Sender to throw an exception
if there is a problem:
$sender = new Mail::Sender({
smtp => 'mymailserver',
from => 'john@mymailserver',
on_errors => 'die',
});
I think you confuse Mail::Sender and Net::SMTP. Mail::Sender and
MIME::Lite is at about the same level.
The big difference is in the philosophy of the modules.
In MIME::Lite you are constructing a message and then when it's
complete, with all the parts and files, you send it as one object.
In MIME::Lite the message is the object.
OTOH in Mail::Sender, you are controling a mail agent, you tell it to
connect to a server and start a multipart mail, then you tell it what
to send as the body, what file to attach and then to close the
message. And the sender does each of those actions immediately.
(Except if you use the MailMsg or MailFile shortcuts that do all
these actions behind the scenes.)
Which means Mail::Sender uses less memory if you are attaching big
files, but if you need more complex multipart messages its interface
is not that nice. And overall Mail::Sender is a bit dirtier :-)
Jenda
===== cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
Jenda Guest
-
John #20
Re: connecting to a mail server via IMAP
Relaying denied.
What is that?
Could i connect to any smtp server i want.
Please enlighten me!
----- Original Message -----
From: "Wiggins d Anconia" <org>
To: "John" <uoi.gr>; "Perl Beginners" <org>
Sent: Tuesday, February 17, 2004 6:40 PM
Subject: Re: connecting to a mail server via IMAP
[/ref]
method?
>
> Path is the location of the file on the local file system, FileName is
> used in the content-disposition header for providing a suggested name
> for the file on the recipient's end which may or may not be used or even
> seen depending on the client. See told you, you didn't want to wrangle
> mail yourself :-)...
>
> http://danconia.org
> [/ref]
> have
> >
> >
> >
> > --
> > To unsubscribe, e-mail: org
> > For additional commands, e-mail: org
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
> >
> >
> >[/ref]
>
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]
John Guest



Reply With Quote

