-1

when emailing from a php form using on online web hosting service/site. when the form is completed, does it go to the email@site.domain.com of the web hosting site or does that email given by the web hosting site send it to another email entered into the php code.

I need examples of what to put in two (actually 3) snippets of code: i don't know what to put in because regardless of what i put in, nothing sends.

$owner_email='';  ---is this my person email or the email from the host server
//SMTP server settings  
$host = '';  ---is this my serverspace or the server provided by the host?
$port = '465';
$username = '';  ---is this...
$password = '';    ....and this necessary? is it my username on the host site?

$subject='A message from your site visitor ';
$user_email='';    
$message_body='';
$message_type='html';

dont know what the previous four lines are for

Next Snippet

if($owner_email=='' || $owner_email==''){
    die('insert warning here');
}

---do i have to input the owner email from above in here?

if(preg_match('/^(127\.|192\.168\.)/',$_SERVER["REMOTE_ADDR"])){
    die('insert warning here');
}

----Do i have to change anything here especially the "REMOTE_ADDR" Again, these belong to a form but when i fill out the form it says its sent even with reCAPTCHA security but when i check both owner and server emails....nothing. what am i missing.

1 Answers1

0

This is a very large question as it seems you may need to do some more research on how PHP and HTML actually work. There are thousands of PHP email form examples. But to answer the few parts of your question...

$owner_email would be the email you want these form posts to be sent to.

$host is whatever email server you will be using to send from. This could be gmail, your hosting servers email settings, etc.

$username is the username to authenticate to this host server. Example: tejdiesel@gmail.com

$password; the password for that email username.

The last 4 lines of your first snippet are all the parts of your email header. The email from the user submitting the form, the subject, the body, and the format.

I'm not sure what the second snippet would be for. It's comparing the email to whatever you'd like, but it doesn't make sense as to why.

The third snippet is also misleading without more information.

TheValyreanGroup
  • 3,554
  • 2
  • 12
  • 30
  • This answer really isn't very useful and this question is way too broad. I don't think there's any real value here. – John Conde Jul 21 '16 at 00:33
  • Its just my first time using this particular method and with some random host that isn't that good. so if im hosting the form on some online server ex. host.com so my site is diesel.host.com. I know thats the server. but i want to send email to tejdiesel@gmail.com but my sever email is form@diesel.host.com is my owner email form@diesel.host.com or tejdiesel@gmail.com? – Tej Diesel Jul 21 '16 at 17:31