473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Sending emails with Php

this is a simple email form of html

Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="example.php">
  2. Recepient's Email:<input name="to" type ="text"><br>
  3. Your Email: <input name="from" type="text"><br>
  4. Message:<br> 
  5. <textarea name="message" rows="15" cols="40"></textarea><br> 
  6. <input type="submit" value="send"> 
  7. </form>
  8.  

but i dont know how to generate example.php
cos i'm totally all new to php
Can you help?
Thx
Aug 20 '07 #1
6 1260
Jeigh
73
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $to = $_POST['to'];
  4. $subject = "Subject Here";
  5. $from = $_POST['from'];
  6. $message = $_POST['message'];
  7.  
  8. $headers = "From: $from \r\n"; 
  9. $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; 
  10. $headers .= "MIME-Version: 1.0 "; 
  11.  
  12. mail($to, $subject, $message, $headers); 
  13.  
  14. ?>
  15.  
This should work, and it is a HTML email. If you don't want it to be you can just change the headers.
Aug 20 '07 #2
ak1dnar
1,584 Expert 1GB
And you have to Configure a SMTP server (For Local Server).
Aug 20 '07 #3
And you have to Configure a SMTP server (For Local Server).

May i know how to configure SMTP server?
And what is POP 3?
Aug 20 '07 #4
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $to = $_POST['to'];
  4. $subject = "Subject Here";
  5. $from = $_POST['from'];
  6. $message = $_POST['message'];
  7.  
  8. $headers = "From: $from \r\n"; 
  9. $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; 
  10. $headers .= "MIME-Version: 1.0 "; 
  11.  
  12. mail($to, $subject, $message, $headers); 
  13.  
  14. ?>
  15.  
This should work, and it is a HTML email. If you don't want it to be you can just change the headers.

Thank you jeigh
thanks for generate an answer for me
Aug 20 '07 #5
ak1dnar
1,584 Expert 1GB
May i know how to configure SMTP server?
Locate your php.ini file and do the changes.


Expand|Select|Wrap|Line Numbers
  1. ; Setup for Windows systems 
  2. SMTP = smtp.your.isp.net 
  3. sendmail_from = me@domain.com
Expand|Select|Wrap|Line Numbers
  1. ; Setup for Linux systems 
  2. sendmail_path = /usr/sbin/sendmail -t 
  3. sendmail_from = me@domain.com
And what is POP 3?
POP3 is the abbreviation for Post Office Protocol (version 3)
It is an e-mail protocol used to retrieve e-mail from a remote server over an Internet connection.
Aug 21 '07 #6
ak1dnar
1,584 Expert 1GB
Thread Title : Generate example.php for me? Changed.

Please Find Why? and how to Create Good Thread Title

Thanks
Aug 21 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
10
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are...
1
by: Ian Taylor | last post by:
Hi all... Is it possible to send RTF-formatted emails using the .NET SmtpMail implementation? I can only find provision in the BodyFormat property of the message to send plain text or HTML...
3
by: VB Programmer | last post by:
My company has it's own webserver, which is going to host our ASP.NET web application. We want the website to be able to send out emails. 1. What do I need on the server so that it has the...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
5
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for...
1
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a shared linux hosting plan from GoDaddy and had the...
2
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.