-sub send {
- $main::lxdebug->enter_sub();
-
- my ($self, $out) = @_;
-
- my $boundary = time;
- $boundary = "LxOffice-$self->{version}-$boundary";
- my $domain = $self->{from};
- $domain =~ s/(.*?\@|>)//g;
- my $msgid = "$boundary\@$domain";
-
- $self->{charset} = Common::DEFAULT_CHARSET unless $self->{charset};
-
- if ($out) {
- if (!open(OUT, $out)) {
- $main::lxdebug->leave_sub();
- return "$out : $!";
- }
- } else {
- if (!open(OUT, ">-")) {
- $main::lxdebug->leave_sub();
- return "STDOUT : $!";
- }
- }
-
- $self->{contenttype} = "text/plain" unless $self->{contenttype};
-
- my ($cc, $bcc);
- $cc = "Cc: $self->{cc}\n" if $self->{cc};
- $bcc = "Bcc: $self->{bcc}\n" if $self->{bcc};