I have a question about PHP.
I want to create a really simple page with only one function.
a text box, and a button to send it to my e-mail address.
**/ I don't really even get the concept of a .php file, or how to implement it to a html file (or do I just create a php file?)
I've been surfing on the web for a way, but quite can't get it.
If you can give me some advice on it, I'd really appreciate it.
I wrote the program, but won't send it to the address("itoyanlifelog#gmail.com").
I'm running it on MAMP, local server.
1) use php mail() function: http://fr2.php.net/manual/en/function.mail.php
2) if you are on a local machine be sure that you can send emails from local. Take a look here: http://wiki.uniformserver.com/index.php/PHP_mail_function
Related
Here is what I want to do:
I have a static shared web page on dropbox, since dropbox is not a server it cannot send mail via php.
My page has an email form, and I wish to point it to a phpmailer file I host on my regular hosting account (instead of the usual setup, where the php file is on the same server).
Will this work? Will the javascript be able to send the values to the php file if it does not reside on the same server?
Off course I can test it, but I thought I might ask the community before I start.
Thanks in advance!
Yes. You will need to host a PHP script somewhere else, but you can point at it from anywhere. You just need to put the full URL of the handler as the action in your form:
<form method="post" action="http://www.example.com/formhandler.php">...
You can do the same thing with javascript XHR/ajax requests.
I am creating my first ever website. I have created a PHP Contact Form. Right now, my html and php files are stored locally, and I do not have a web host yet.
When the Submit button is clicked, the PHP file is downloaded, rather than the email message being sent. How can I get the Contact Form to send an email? Do I need a web host, first, before I can do this?
Sounds like you are loading your HTML files in a web browser and when they submit to the PHP page it loads the page. This is because you need a web server to actually process the PHP script.
If you're running Windows you can look into WAMPServer.
There's also MAMP for Macs.
And Xampp which works on Windows, Macs, and Linux.
There are lots of tutorials for using each f them so getting started should be easy to do.
I have a strange requirement.
I need to read the outlook emails from a local pc using php .
I will get user credentials.
so is there any way to do this ?
it need to work well in all major browsers.
Thanks.
Not sure why you would want to try to get this from a LOCAL mail file on a 'single' pc, I would rather attack this from a POP3/IMAP route, it would THEN be a PHP based mail client, or whatever you need it for (fetching mail, filtering, checking, triggering an event, etc;).
But what you describe is just not feasible for anything, I can't see a client paying to have simple client mail accessed via PHP.
Here are some PHP / Email reading references:
http://garrettstjohn.com/entry/reading-emails-with-php/
http://davidwalsh.name/gmail-php-imap
http://www.tuxradar.com/practicalphp/15/6/3
I am using this PHP form builder class but I think I'm missing the very basic which is how to send the email. I know enough php to download and modify the code but not quite sure how to implement:
mail(to,subject,message,headers,parameters)
Does anyone know how to get this working and send the email to myself when the form is submitted?
Take a look at the PHP documentation, or better use some abstracted class like swiftmailer. Swiftmailer will save you some hassle down the line, as it sets the headers correctly and is independant from the mail subsystem.
Here is a basic example how to include swiftmailer
You don't have to implement the mail function, it should already be there and it has been there by default since PHP 4.
If you're not finding a mail function (or if it is not working), then chances are that you are not running on a machine where PHP has access to the sendmail command. You can read about the requirements of the mail function here. If this is the case (and you have to be able to test the emails), then you will need to get a mail server. If you're on Windows, I know that XAMPP comes with one, but I normally do that sort of development with a Linux box.
I've just made some fixes to a web site that uses the Form2Mail PHP script. This worked on my home machine, a while back, but I have suddenly been pressured to release today, and it is already 3pm here.
I am an ASP.NET developer and know very little PHP, so if I have to improvise, writing my own version of the script is not a very feasible option. What other options to I have that can allow me to, out of the box, cause an HTML form's submit event to result in an email being sent to a configured email address?
sending mails in php is very simple http://php.net/manual/en/function.mail.php
you would just put a form that submits to something like mail.php, stick some mail code in there and you are done