PHP mail()

merrillmck

New Member
Messages
134
Reaction score
0
Points
0
Can anyone help me with the non-programming steps to create a feedback-form on your site?

Let's say I create a .php page and use php's built-in mail function. I have a mail setup through X10. What connects my .php page to my X10 mail?

A good link would also suffice. I'm looking at a php teaching page but not following their explanation.

Thx,
PHP noob
 

merrillmck

New Member
Messages
134
Reaction score
0
Points
0
I'm not sure what the restrictions are on both of these methods right now. mail() may be disabled and fsockopen() still has some restrictions. Here's tutorials on both for you:

mail(): http://www.w3schools.com/PHP/php_mail.asp

fsockopen(): http://www.110mb.com/forum/how-to-send-simple-text-mail-with-php-fsockopen-t28551.0.html

If mail() was disabled, what would be the norm for creating a Feedback or Contact form on a webpage? The fsockopen() you just mentioned?

Thanks
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
251
Points
63
Yes, mail() and fsockopen() are the two standard methods.

You may also consider using a database with the contact information and then periodically checking it for new entries. This is an easier solution, but clearly not as easy for you to use ;)
 

merrillmck

New Member
Messages
134
Reaction score
0
Points
0
Yes, mail() and fsockopen() are the two standard methods.

You may also consider using a database with the contact information and then periodically checking it for new entries. This is an easier solution, but clearly not as easy for you to use ;)

Anyone have an example of a php.ini file with email configured? I'm learning I need to have one either in public_html or the .php folder.

Thanks,
PHP noob
 

Anna

I am just me
Staff member
Messages
11,756
Reaction score
583
Points
113
you can not have your own php.ini file

normally mail() is enabled, and I think it is re-enabled after maintenance on your server, if not it will be in a near future.
 

merrillmck

New Member
Messages
134
Reaction score
0
Points
0
you can not have your own php.ini file

normally mail() is enabled, and I think it is re-enabled after maintenance on your server, if not it will be in a near future.

If and when php.mail() gets re-enabled, X10 will create a read-only php.ini file that will have my X10 email settings in it? I'm just trying to understand how this all works.
 

Anna

I am just me
Staff member
Messages
11,756
Reaction score
583
Points
113
no, you will not get a php.ini file (at least not one that you can see).

I'm not 100% sure on how it works for shared hosting. I've only messed with it for my testing environment on my own computer. But I've never seen a php.ini file in my account.
 

bamboohead

New Member
Messages
4
Reaction score
0
Points
0
i'm not able to get mail working? Does anybody know if there is any settings I need to perform beforehand? And mail returns true.

<?php
// The message
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send
mail('som@validmail.com', 'My Subject', $message);
?>
 

lucia1

New Member
Messages
28
Reaction score
0
Points
0
Can anyone help me with the non-programming steps to create a feedback-form on your site?

Let's say I create a .php page and use php's built-in mail function. I have a mail setup through X10. What connects my .php page to my X10 mail?

A good link would also suffice. I'm looking at a php teaching page but not following their explanation.

Thx,
PHP noob

Go to http://www.thesitewizard.com/thesitewizard.xml. If you do not already have it solved this worked for me. Find the PHP feedback form script and follow the instructions to the letter. PHP is unforgiving, even missing a space in the code will through it off. This is a very good learning site!

I am working on a site. To see the form in action, go to http://ventana.x10hosting.com/feedback.html. Try sending me an email from the form. so far I have been the only person to use it.
Good luck!
 
Top