Current location: Hot Scripts Forums » Programming Languages » PHP » send mail


send mail

Reply
  #1 (permalink)  
Old 08-15-07, 07:32 AM
ther's Avatar
ther ther is offline
Newbie Coder
 
Join Date: Jul 2007
Location: Budapest,Hungary
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
send mail

I want to send mail with php ( not with the mail function, because i dont have sendmail set up on my server ! ), fo far i found this:

PHP Code:

 function sendmail($ToName$ToEmail$FromName$FromEmail$Subject$Body$Header) {

    
$smtp fsockopen("195.225.245.1"25$errno$errstr);
    
    if ( !
$smtp ) echo "SMTP connect error ($errno): $errstr";
    
    
$InputBuffer fgets($smtp1024);
    
    
fputs($smtp"HELO smtp.freemail.hu\n");
    
$InputBuffer fgets($smtp1024);
    
fputs($smtp"MAIL From: $FromEmail\n");
    
$InputBuffer fgets($smtp1024);
    
fputs($smtp"RCPT To: $ToEmail\n");
    
$InputBuffer fgets($smtp1024);
    
fputs($smtp"DATA\n");
    
$InputBuffer fgets($smtp1024);
    
fputs($smtp"$Header");
    
fputs($smtp"From: $FromName <$FromEmail>\n");
    
fputs($smtp"To: $ToName <$ToEmail>\n");
    
fputs($smtp"Subject: $Subject\n\n");
    
fputs($smtp"$Body\r\n.\r\n");
    
fputs($smtp"QUIT\n");
    
$InputBuffer fgets($smtp1024);
    
    
fclose($smtp);

But this doesnt work... It gives:

HTML Code:
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.freemail.hu:25 (No route to host) in /home/ther/hydra/smtp.php on line 4
SMTP connect error (113): No route to host
any help ?
__________________
ther
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attachement help needed sujata_ghosh Perl 18 06-22-07 01:00 PM
Send Mail sharad PHP 3 09-11-06 08:55 AM
send mail to all msn contacts de_majoor Script Requests 2 09-20-05 01:56 PM


All times are GMT -5. The time now is 06:08 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.