Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NT and sending mail (with perl)

Status
Not open for further replies.

jez

Programmer
Joined
Apr 24, 2001
Messages
370
Location
VN
Hi there,
I am using Geocel's Devmailer to get Matt's FormMail.pl to work on IIS 4 (and it does, just great!)..

BUT I want to write another script of my own that sends mail (among other things).

I already wrote a Unix version using Sendmail (nice and straight forward) but now I can't seem to find any decent info on doing the equivalent on NT, and it is quite different!!!
I am getting strange errors as I have tried to use this Devmailer as an OLE object - the company who make this give no help other than offering scripts that work with it.

Anybody who can give me any tips on writing mail functions in Perl for NT, please help.

Many thanks

Jez
 
i don't honestly know anything about sending mail through an NT app like that, BUT couldn't you just do some cut-and-paste programming with one of their functional scripts to get your scripts to work? "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
I work on an NT box, but I use PerlScript instead of perl... only because I can use the ASP objects easily. Check out the following function I made up for mailing:

sub mail{
my ($to, $from, $subject, $message) = @_;
my $myMail = $Server->CreateObject("CDONTS.NewMail");
$myMail->Send($from,$to,$subject,$message,0);
}

#That $Server object is part of ASP. Mighty useful.
#You might want to check out using perl with asp.

-k
 
There is a win32 app called BLAT that emulates sendmail. You could use that (search for it on Google). However, I usually try to avoid making system() calls in web based applications.. During a security audit I conducted with one of my clients, breaking into a system running Matt's Formmail with Blat was trivial. Therefore, I would look into using the Net::SMTP module or something of the like available from CPAN to send directly through sockets.

Good luck,

brendanc@icehouse.net
 
Thanks for all these suggestions, I shall try as many as possible.

BUT I have got it working now, it seems whitespaces matter alot when creating objects.

Just FYI, I got this problem from 'cut-&-paste' programming, because once pasted and altered to fit the rest of the script, I was then unable to tell how the line flagged in the error log was wrong (with no reference but a working script).

AND thanks to Kempis555, I haven't yet looking into perlscripting for ASP, but I will now!!!

AND lastly, due to the security issues brought up about BLAT, I will try the net::SMTP module because this program is quite similar to BLAT.


Thanks again for your help...this forum is full of really helpful people!!


Jez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top