README
1NAME
2 WWW::Hotmail - Connect to Hotmail, download, delete and send messages
3
4SYNOPSIS
5 use WWW::Hotmail;
6
7 my $hotmail = WWW::Hotmail->new();
8
9 $hotmail->login('foo@hotmail.com', "bar")
10 or die $WWW::Hotmail::errstr;
11
12 my @msgs = $hotmail->messages();
13 die $WWW::Hotmail::errstr if ($!);
14
15 print "You have ".scalar(@msgs)." messages\n";
16
17 for (@msgs) {
18 print "messge from ".$_->from."\n";
19 # retrieve the message from hotmail
20 my $mail = $_->retrieve;
21 # deliver it locally
22 $mail->accept;
23 # forward the message
24 $mail->resend('myother@email.address.com');
25 # delete it from the inbox
26 $_->delete;
27 }
28
29 $hotmail->compose(
30 to => ['user@email.com','otheruser@otheremail.com'],
31 subject => 'Hello Person!',
32 body => q[Dear Person,
33
34 I am writing today to tell you about something important.
35
36 Thanks for all your support.
37
38 Sincerely,
39 Other Person
40 ]) or die $WWW::Hotmail::errstr;
41
42DESCRIPTION
43 This module is a partial replacement for the "gotmail" script
44 (http://ssl.usu.edu/paul/gotmail/), so if this doesn't do what you want,
45 try that instead.
46
47 Create a new "WWW::Hotmail" object with "new", and then log in with your
48 MSN username and password with the "login" method.
49
50METHODS
51 login
52 Make sure to add the domain to your username, for example
53 foo@hotmail.com. Then this will allow you to use the "messages" method
54 to look at the mail in your inbox. The login method does not retrieve
55 messages on login. The messages method does that now.
56
57 messages
58 This method returns a list of "WWW::Hotmail::Message"s; each message
59 supports four methods: "subject" gives you the subject of the email,
60 just because it was stunningly easy to implement. "retrieve" retrieves
61 an email into a "Mail::Audit" object - see Mail::Audit for more details.
62 "from" gives you the from field. Finally "delete" moves it to your
63 trash.
64
65 compose
66 You can use the "compose" message to send a message through the account
67 you are currently logged in to. You should be able to use this method as
68 many times and as often as you like during the life of the
69 "WWW::Hotmail" object. As its argument, it takes a hash whose keys are
70 "to", "cc", "bcc", "subject", "body". Newlines should work fine in the
71 "body" argument. Any field can be an array; it will be joined with a
72 comma. This function returns 1 on success and undef on failure. Check
73 $WWW::Hotmail::errstr for errors, or use $WWW::Hotmail::errhtml for an
74 html version of the error.
75
76NOTES
77 This module used to croak errors for you. If you would like this
78 behavior, then add $WWW::Hotmail::croak_on_error = 1; to your script. It
79 will not croak html.
80
81 This module should work with email addresses at charter.com, compaq.net,
82 hotmail.com, msn.com, passport.com, and webtv.net
83
84 This module is reasonably fragile. It seems to work, but I haven't
85 tested edge cases. If it breaks, you get to keep both pieces. I hope to
86 improve it in the future, but this is enough for release.
87
88SEE ALSO
89 WWW::Mechanize, Mail::Audit, "gotmail"
90
91AUTHOR
92 David Davis, <xantus@cpan.org> - I've taken ownership of this module,
93 please direct all questions to me.
94
95ORIGINAL AUTHOR
96 Simon Cozens, <simon@kasei.com>
97
98CONTRIBUTIONS
99 David M. Bradford <dave@tinypig.com> - Added the ability to send
100 messages via hotmail.
101
102COPYRIGHT AND LICENSE
103 Copyright 2003-2004 by Kasei Copyright 2004 by David Davis
104
105 This library is free software; you can redistribute it and/or modify it
106 under the same terms as Perl itself.
107
108