Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Sending Simple Email PHP (http://www.go4expert.com/forums/sending-simple-email-php-t18557/)

rendra_mm2 16Jul2009 09:28

Sending Simple Email PHP
 
please check these file ! i need help ! why i can't receive that email ? :nonod:

shabbir 16Jul2009 09:36

Re: Sending Simple Email PHP
 
Attachment removed. Try putting the code inline so its easy for us to look and suggest

rendra_mm2 16Jul2009 09:40

Re: Sending Simple Email PHP
 
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);
    }
}
?>


shabbir 16Jul2009 10:31

Re: Sending Simple Email PHP
 
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

rendra_mm2 16Jul2009 10:35

Re: Sending Simple Email PHP
 
Quote:

Originally Posted by shabbir (Post 52715)
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 ? :thinking:

rendra_mm2 16Jul2009 10:41

Re: Sending Simple Email PHP
 
I'm confuse ... Why ? Damn'

shabbir 16Jul2009 11:05

Re: Sending Simple Email PHP
 
Where are you running that scripts ?

rendra_mm2 16Jul2009 11:08

Re: Sending Simple Email PHP
 
Quote:

Originally Posted by shabbir (Post 52722)
Where are you running that scripts ?

http://elearning-stmhabibi.net/mail.php

shabbir 16Jul2009 12:22

Re: Sending Simple Email PHP
 
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.

rendra_mm2 16Jul2009 12:26

Re: Sending Simple Email PHP
 
Quote:

Originally Posted by shabbir (Post 52726)
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 ... :happy: :wacky:


All times are GMT +5.5. The time now is 07:10.