|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help needed for using SMTP!
Hi,
i'm using a simple routine for sending mails: Code:
sub sendemail {
my ($to,$from,$subject,$message) = @_;
open MAIL, "|$config{'sendmail'}";
print MAIL "To: $to\nFrom: $from\nSubject: $subject\n\n$message\n\n";
close MAIL;
}
In $config{'sendmail'} is the path to sendmail saved. Now i'm trying to use additionally smtp - i thought adding anything like: $config{'mailmethod'} Here i'll save the choosen mailmethod (like 1 for sendmail and 2 for smtp) and than adding $config{'smtp'} with the name of the smtp-server into my config-file ... Could anyone help me in using smtp without any additional perl-modules? Thanks! |
|
#2
|
|||
|
|||
|
>> In $config{'sendmail'} is the path to sendmail saved
If your MTA is Sendmail and not a sendmail wrapper, you need to should the -t switch. >> Now i'm trying to use additionally smtp For what reasons? |
|
#3
|
|||
|
|||
|
Quote:
For those cases where it has to run on nt-servers. |
|
#4
|
|||
|
|||
|
Try Mail::Sender.
Synatx: use Mail::Sender; $sendmail = new Mail::Sender({from => "Maglight <$from>" , smtp => '12.34.56.78'}) || die &error("$Mail::Sender::Error"); $sendmail->MailMsg({to =>'$to', subject => '$subject', msg => "$message"}); If smtp => '12.34.56.78' is left out, it assumes to be localhost. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Help needed for using SMTP! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|