I'm trying to make my UBB send out passwords via email using blat, as my ISP doesn't allow me to relay email through the SMTP server via the ubb. I know it sucks, but I'll have to live with it.
Anyway, what I'm trying to replace the SendEmail sub with is...
[QUOTE]<font face="Verdana, Arial, Helvetica" size="2">
sub SendEmail {
## Uses these variables: $EmailServer, $sendto, $from,
## $subject, and $message
$from = "$BBEmail";
$protocol = getprotobyname('tcp');
socket(SOCKET,PF_INET,SOCK_STREAM,$protocol);
$remote_ip = gethostbyname($EmailServer);
$remote_sock = pack('Sna4x8', AF_INET, 25, $remote_ip);
$blat="blat.exe "$message" -s "$subject" -t "$sendto" -server $EmailServer -f "$from"";
system($blat);
}
</font>[/QUOTE]I'm not too fussed about setting it up for multiple recipients, I just want a quick and dirty way to send out passwords via email. No mass mailings to my users, no UBBFriend or anything, just passwords.
I get no error messages when I use my code(I know it's because I have no error handling routines in there

) but I get no email output. Using the same sub in a script of its own, replacing the variables with fixed data(senders email addy, etC) works fine.
I'm
not a perl programmer, I've just been reading through the code and trying to hack it. I know it's probably going in the completely wrong direction, but I really need to make this work and cannot find anything about it at
UBBDev.com or ubbhackers.com.
Any help or advice is much appreciated.
Thanks,
Rich