473,396 Members | 1,749 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,396 software developers and data experts.

How to send mail by using PHP?

Hello Friends....

I want to send mail by using PHP. I am using Linux. Please guide me to do this... DO i need to install any special s/w for this???

Please help me...
Jun 20 '11 #1
5 1586
Markus
6,050 Expert 4TB
Hi, Rekha.

In PHP there is the mail function, however, it is fairly limited in functionality. Instead, you'll typically use a library such as SwiftMailer or PHPMailer.
Jun 20 '11 #2
Will u plz post any simple code?

PHPMailer - Do i need to install it???
Jun 20 '11 #3
I tried this one. But its not working :(
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  $to = "rekssss@gmail.com";
  3.  $subject = "Hi!";
  4.  $body = "Hi,\n\nHow are you?";
  5.  if (mail($to, $subject, $body)) {
  6.    echo("<p>Message successfully sent!</p>");
  7.   } else {
  8.    echo("<p>Message delivery failed...</p>");
  9.   }
  10.  ?>
  11.  
Jun 20 '11 #4
Markus
6,050 Expert 4TB
The respective documentation for both libraries (that will need downloading) have example code for you to look at - I will not rewrite it.

SwiftMailer: http://swiftmailer.org/docs/introduction
PHPMailer: http://phpmailer.worxware.com/index.php?pg=examples
Jun 20 '11 #5
Thanks for your link...

I will read and try it..........
Jun 20 '11 #6

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

Similar topics

1
by: Edward | last post by:
My computer is at intranet,I want to use following code to realizing function of sending mail.But this program only can send mail between intranet.If I send mail in internet,I need to through proxy...
0
by: Henrik Bergman | last post by:
Hi all As I subscribe MSDN I got an USB-memory with Microsoft eLearing library. I found an exampell how to send SMTP e-mail using CDO.Message object and CDO.Configuration. But when I try to...
0
by: Elankathir S.N. | last post by:
Hi All, I’m using ASP with VBScript…and I need to send mails using Lotus Notes Mail Server (IBM). How to communicate to the Lotus Notes Server and send mails??? Thanks, - Elan
2
by: Senthilkumar | last post by:
Hi, I would like to send mail using Outlook or Outlook Express my .net program which is written using vb.net . When ever a new record of particular type is added, i would like to send an...
0
by: Tidan | last post by:
Hi, I would like to send mail using Outlook Express my .net program which is written using vb.net 2.0. When ever a new record of particular type is added, i would like to send an automatic mail...
6
by: AbraAbraCadabra | last post by:
Here is the code I have been using to send mail... Set objCDO = Server.CreateObject("CDO.Message") With objCDO .To = strTo .From = "markus@domain.com" .Subject = "This is the...
4
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword...
0
by: PraveenKatiyar | last post by:
Hi, when i send mail using xp_smtp_sendmail it gives error--- Server response: 554 <libsoft@iitk.ac.in>: Sender address rejected: Access denied I m using-- declare @rc int exec @rc =...
2
acoder
by: acoder | last post by:
How to Send Mail in Coldfusion You can use Coldfusion to easily send mail. From simple plain text emails to more complex HTML and multipart emails, the job is made a lot easier with Coldfusion. ...
1
by: ghjk | last post by:
I want to send mail when user click "forgot password " button. This is my code and It doesn't send a mail. Could somebody tell me what is wrong with my code? require_once "Mail.php"; $from =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.