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

Go4Expert Member
16Jul2009,09:28   #1
rendra_mm2's Avatar
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
Go4Expert Founder
16Jul2009,09:36   #2
shabbir's Avatar
Attachment removed. Try putting the code inline so its easy for us to look and suggest
Go4Expert Member
16Jul2009,09:40   #3
rendra_mm2's Avatar
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
Go4Expert Founder
16Jul2009,10:31   #4
shabbir's Avatar
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
Go4Expert Member
16Jul2009,10:35   #5
rendra_mm2's Avatar
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 ?
Go4Expert Member
16Jul2009,10:41   #6
rendra_mm2's Avatar
I'm confuse ... Why ? Damn'
Go4Expert Founder
16Jul2009,11:05   #7
shabbir's Avatar
Where are you running that scripts ?
Go4Expert Member
16Jul2009,11:08   #8
rendra_mm2's Avatar
Quote:
Originally Posted by shabbir View Post
Where are you running that scripts ?
http://elearning-stmhabibi.net/mail.php
Go4Expert Founder
16Jul2009,12:22   #9
shabbir's Avatar
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.
Go4Expert Member
16Jul2009,12:26   #10
rendra_mm2's Avatar
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 ...