Previous Thread
Next Thread
Print Thread
Hop To
Anonymous
Unregistered
Anonymous
Unregistered
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>
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 <img src="https://www.ubbcentral.com/boards/images/graemlins/laugh.gif" alt="" /> ) 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

Anonymous
Unregistered
Anonymous
Unregistered
When asking a question, be sure to be as specific as you can. Make sure to include:
- The URL to your board
- The version number of your UBB, written as 5.XX(x), as in 5.39c. Currently, the lastest version of UBB is 5.47b.
- Whether you're performing a full/clean installation of UBB or an upgrade.
- The name and URL of your webhost.
- Any error message you receive. Netscape is usually more descriptive in it's error messages than Internet Explorer is, so if possible, try to view the error with Netscape.


are you self hosting?

Anonymous
Unregistered
Anonymous
Unregistered
I'm by no means an expert in this field, but wouldn't you need to escape the subject and message?

Just a thought <img src="https://www.ubbcentral.com/boards/images/graemlins/smile.gif" alt="" />


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Selling a Forum?
by ECNet - 10/10/2026 10:54 AM
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Who's Online Now
0 members (), 393 guests, and 148 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)