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 = "someone@example.com"; //change to a valid email
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com"; //change to a valid email
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?> 

Link to comment
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...

Link to comment
Share on other sites

I have done the setting in php.ini by amended these but I am not sure what I did was right...

 

mail.add_x_header "0"

mail.log NULL

SMTP "localhost"

smtp_port "25"

sendmail_from myemailaddress@hotmail.com

sendmail_path (disable) I dont know what to put here.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.