Jump to content

Need help about mailer function.


siabanie

Recommended Posts

Hi guys I need some help here about mailer.

 

I have created a file register new user (register.php) and when a new user register an email will be sent to their address.

 

I have this code on my register file but when I run them it's okay but I did not get the email... can anyone assist me what I did wrong?

 

Thanks.

 

<?php
$to = "[email protected]"; //change to a valid email
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]"; //change to a valid email
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?> 

Link to comment
https://forums.phpfreaks.com/topic/231471-need-help-about-mailer-function/
Share on other sites

I see - well the mailer code that I have shown did not have any error - when I register a new user and click submit it will redirect to the thank you page. There is no error showing.

 

But I did not get the email...that is what bugging me.

 

I have placed the code you suggested but there is not warning or what-so-ever, the script went through fine...but I am not getting an email...

I have installed the ArGoSoft Mail Server. And create a new user.

 

I don't really know how it works but I fill in all the information e.g but not sure what I did is correct?

 

Forward Address: test@localhost

Return Address: another@localhost

 

Do I have to changed in php.ini or where?

Doesn't matter which MUA. Just open outlook and create a new account on email adress test@localhost(must be created @ argosoft mail server).

 

SMTP & POP3 server = localhost

 

php.ini SMTP = localhost

 

sendmail_from = test@localhost (or another).

 

Dont forget to restart apache

Hi MrXHellboy,

 

I am not sure if I got your instruction correctly..

 

But I have created a new user on the argosoft mail server providing all the info e.g

 

User Name:test

Real Name:test

Password:test123

Forward Address:test@localhost

Return Address:test@localhost

 

And on the outlook I just created:

 

Incoming mail server:localhost

Outgoing mail server:localhost

 

But it is still not working...I think I did not get it correct.

Any idea?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.