View Poll Results: Why i can't receive ?
Bad Script ? 0 0%
Wrong Script ? 0 0%
Other ... 3 100.00%
Voters: 3. You may not vote on this poll

Sending Simple Email PHP

rendra_mm2's Avatar, Join Date: Jul 2009
Go4Expert Member
please check these file ! i need help ! why i can't receive that email ?

Last edited by shabbir; 16Jul2009 at 09:36.. Reason: Attachment Removed
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Attachment removed. Try putting the code inline so its easy for us to look and suggest
0
rendra_mm2's Avatar, Join Date: Jul 2009
Go4Expert Member
mail.php

PHP Code:
<?php
include "generator.class.php";
if (isset(
$_POST['email']) && isset($_POST['submit'])){
    
$gen->id(6);
    
$gen->mail($_POST['email'],'http://'.$SERVER_NAME.'/mjk/sub/register.php?id='.$gen->id.'');
}
if(isset(
$_POST['submit']) && empty($_POST['email'])){
    
$gen->alert('Email jangan dikosongi');
}
?>
<div style="font-family:trebuchet ms;" >
<div id="forms">Email Registrasi </div>
<div id="biasa">
<form name="mail" method="post" action="page.php?menu=mail">
  <table border="0" cellspacing="0" cellpadding="3">
    <tr>
      <td>Send email to</td>
      <td>:</td>
      <td><input type="text" name="email" size="30"/></td>
      <td align="center"><input name="submit" type="submit" value="Kirim" /></td>
    </tr>
</table>
</form>
</div>
</div>

<hr>
generator.class.php
PHP Code:
class generator extends MYSQL{
    function 
mail ($receiver$url){
        require_once(
"class.mail.php");
        
        
$mail = new mailsend();
        
$mail->to="".$receiver."";
        
$mail->subject="Form Registrasi Subdomain";
        
$mail->message="".$url." Klik link disamping untuk melanjutkan registrasi secara online";
        
$mail->header='From: [email]subdin_pde@mojokertokab.go.id[/email]' "\r\n" .
                        
'Reply-To:subdin_pde@mojokertokab.go.id' "\r\n" .
                        
                        
'X-Mailer: PHP/' phpversion();
        
$mail->send();
    }
}

<
hr
class.mail.php
PHP Code:
<?php

class mailsend {
    var 
$to;
    var 
$subject ;
    var 
$message 
    var 
$header ;
    function 
send(){
    
mail($this->to$this->subject$this->message$this->header);
    }
}
?>

Last edited by shabbir; 16Jul2009 at 10:28.. Reason: Code blocks
chandu_99917 like this
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Why dont you try just this one line script

PHP Code:
mail('you@yourdomain.com''My Subject''My Message'); 
And see if it works.

If you are using your local computer you would need an SMTP server to relay the email
0
rendra_mm2's Avatar, Join Date: Jul 2009
Go4Expert Member
Quote:
Originally Posted by shabbir View Post
Why dont you try just this one line script

PHP Code:
mail('you@yourdomain.com''My Subject''My Message'); 
And see if it works.

If you are using your local computer you would need an SMTP server to relay the email
I've tried it ... until now ,,, im not receive my Test email,,, What's the problem ?
0
rendra_mm2's Avatar, Join Date: Jul 2009
Go4Expert Member
I'm confuse ... Why ? Damn'
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Where are you running that scripts ?
0
rendra_mm2's Avatar, Join Date: Jul 2009
Go4Expert Member
Quote:
Originally Posted by shabbir View Post
Where are you running that scripts ?
http://elearning-stmhabibi.net/mail.php
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
There could be 2 reasons then

1. Emails are in your spam folder
2. Else either the mail server is not running or it needs a username password before you can send an email.
0
rendra_mm2's Avatar, Join Date: Jul 2009
Go4Expert Member
Quote:
Originally Posted by shabbir View Post
There could be 2 reasons then

1. Emails are in your spam folder
2. Else either the mail server is not running or it needs a username password before you can send an email.
Ooowwhhh,,,,, maybe mail server...

So... can u help me ?
Would u like to give me your success PHP Mail Script ... ??? Please ...