Need php mail help

Link to my mail script:
https://pastebin.com/3BbPwwcc

Thank you @ckhawand for helping me last time.

I got this script from internet
Help me fix the mail script i want to email that particular user after that user registers successfully.

1 Like

It should send an email though :confused:

but i want to set default ‘from’ field to : noreply@myemail.com and ‘to’ field to that user email.

Replace

$headers = 'From: '.$email_from."\r\n".

By

$headers = 'From: No Reply <noreply@youremail.com> \r\n'.
1 Like

and what about $email_to in 5th line should i remove that?

Nope, you shouldn’t :slight_smile:

@ckhawand i tried and now getting error 500

i’ve added this script after insert into db query.

i’m not able to see DM option.

try now. :slight_smile:

1 Like

Can’t help you at the moment as I’m a bit sick :pensive:

1 Like

I’m getting error 500 while execution
any help

actually what i want is as after the ‘insert into db query’ finishes then i want to send email to that registered email.
so email_to should to set to $_POST[‘email’] or anything like this to send that particular user an email.

or can you help me build an php mail script to send email to that particular user after registration with these fields which i can place after insert into database query
$_POST[‘user_id’])
$_POST[‘first_name’])
$_POST[‘dob’])
$_POST[‘jobrole’])
$_POST[‘con_date’]
as above email_to should be taken from $_POST[‘email’]; and email that user so that its not the same email everytime.

thank you in advance.