Thread mail::sender: mail::sender und die Formatierung (4 answers)
Opened by ypswes at 2006-02-01 12:51

renee
 2006-02-02 13:32
#47659 #47659
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

use strict;
use warnings;
use Mail::Sender;

my $file = '/path/to/file/with/html.sourcen';

open(my $fh,"<",$file) or die $!;
my $text = join('',<$fh>);
close $fh;

my $sender = new Mail::Sender {
smtp => 'smtp.isp.tld',
from => 'test@your-domain.tld',
auth => 'LOGIN',
authid => 'username',
authpwd => 'passwort',
on_errors => undef,
} or die "Can't create the Mail::Sender object: $Mail::Sender::Error\n";

$sender->OpenMultipart({to => 'empfaenger@domain.tld',
subject => "HTML test ",
ctype => "text/html; charset=iso-8859-1",
encoding => "quoted-printable"}) or die $Mail::Sender::Error,"\n";
$sender->SendEnc($text);
$sender->Close();
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread mail::sender: mail::sender und die Formatierung