Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!perl
- use strict;
- use Email::Send;
- use Email::Send::Gmail;
- use Email::Simple::Creator;
- use Data::GUID;
- my $guid = Data::GUID->new;
- my $icalUID = $guid->as_string;
- my $bodyText = <<"VCALTEXT";
- BEGIN:VCALENDAR
- PRODID:-//ACME/DesktopCalendar//EN
- METHOD:REQUEST
- VERSION:2.0
- BEGIN:VEVENT
- ORGANIZER:mailto:bring1\@alumni.lsu.edu
- ATTENDEE;ROLE=CHAIR;ATTSTAT=ACCEPTED:mailto:bring1\@alumni.lsu.edu
- ATTENDEE;RSVP=YES:mailto:bring\@belltec.com
- DTSTAMP:20150518T190000Z
- DTSTART:20150520T210000Z
- DTEND:20150520T230000Z
- SUMMARY:Phone Conference
- DESCRIPTION:Please review the attached document.
- UID:$icalUID
- ATTACH:ftp://ftp.bar.com/pub/docs/foo.doc
- STATUS:CONFIRMED
- END:VEVENT
- END:VCALENDAR
- VCALTEXT
- my $email = Email::Simple->create(
- header => [
- From => 'ovhrecon@gmail.com',
- #To => 'bring@belltec.com',
- To => 'bring@belltec.com',
- #Cc => 'bring@belltec.com',
- Subject => "Phone Conference",
- ],
- body => $bodyText,
- );
- $email->header_set( 'Content-Type' => 'text/calendar;' );
- $email->header_set( 'method' => 'request;' );
- my $sender = Email::Send->new(
- { mailer => 'Gmail',
- debug => 0,
- mailer_args => [
- #username => 'bkrspam2012@gmail.com',
- #password => 'p3rfection',
- username => 'ovhrecon@gmail.com',
- # Obfuscated by www.perlobfuscator.com
- password => "\x32\x32\x77\x68\x6F\x64\x61\x74\x24\x25",
- ]
- }
- );
- eval { $sender->send($email) };
- if ($@) {
- die "Error sending email: $@";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement