473,813 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why the mail cant work?

65 New Member
Hi all,

Expand|Select|Wrap|Line Numbers
  1. <?
  2. $email="you@example.com";
  3. $subject="Enter your subject here";
  4. $message="Enter your message here";
  5. mail($email,$subject,$message,"From:$email");
  6. ?>
  7.  
Why the mail i cant receive? Is it got setting in linux?

Can anyone guide me?

Thanks in advance.
Oct 25 '07 #1
4 1318
Atli
5,058 Recognized Expert Expert
Hi.

What exactly is the problem?
Are you getting any errors?

The code itself looks OK. Should work.
Oct 25 '07 #2
wish
65 New Member
No error and no output. I keep check my mail box but the mail is not coming.

Is it use mail function in php got other settings to allow the mail function to work?

If yes, please guide me where should i change the settings.

Thanks.
Oct 25 '07 #3
Atli
5,058 Recognized Expert Expert
The mail() function returns a boolean value, indicating whether or not it was successful. So I recommend doing something like this:
Expand|Select|Wrap|Line Numbers
  1. if(mail(...)) {
  2.   echo "Mail sent successfully.";
  3. }
  4. else {
  5.   echo "Mail could not be sent!";
  6. }
  7.  
You will need set the values for 'SMTP' and 'smtp_port' in your php.ini file to a valid SMTP server.
Oct 25 '07 #4
wish
65 New Member
Hi,

where is the php.ini located?

Is it i change the SMTP then is ok?Cos i am new for linux setting.

I try now.

Thanks.
Oct 25 '07 #5

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

Similar topics

8
3335
by: Ammar | last post by:
Hi all... Could anyone please tell me how to use ASP to send mail from my local web server (using IIS on wWindowsXP-pro)? what are the necessary setting needed in IIS to enable mail sending? and how can i send mail?? I tried many web sited but the codes I get simply dont work at all!!! I am really going nuts here! thanks
6
5076
by: erdem kemer | last post by:
i cant send mail to yahoo mail or hotmail while i can send my other mail accounts (pop3) is it becouse yahoo and hotmail is web-based mail here is the code MailMessage mailMsg = new MailMessage(); mailMsg.From = from; from = from + from;
5
1328
by: Lars Grøtteland | last post by:
Hello! I have a single question. I was wondering how I can start the default mail application (handler) with asp.net? -- - Lars
5
2239
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to this class that will send email, however my class will not seem to recognise the system.web.mail.mailmessage. my first impression on this is that I may have to use some sort of third
12
1228
by: Sohail Carim | last post by:
does anyone know how to go about implementin an e-mail function directly from a vb . net application... I am a university student and this topic is giving me grey hair!
9
1077
by: Crirus | last post by:
Just simple mails plain text -- Ceers, Crirus ------------------------------ If work were a good thing, the boss would take it all from you ------------------------------
2
2039
by: Bandul | last post by:
Hi everyone I am trying to send a e-mail using the mail() function. Now i try to send more than one data from mysql database so i must use example $results=mysql_num_rows($result_query) for(i=0; $i < $results; i++) { $row=mysql_fetch_array($result_query);
8
3226
by: jack | last post by:
Hi, Im trying to send mail from asp.net page to gmail account. Im trying to do this with the help of below code, but cant archive it. MailMessage message = new MailMessage("xxx@gmal.com", "xxx@gmal.com", "xxx@gmal.com", "xxx@gmal.com"); SmtpClient smtp = new SmtpClient("smtp.gmail.com",465);
1
917
by: =?Utf-8?B?VGltb3RoeQ==?= | last post by:
Hi all, who can help me , recently i found a problem from the window mail whic are i am using my own personal mail account and try to using window mail to log in. anywhre i can receive some of the mail from my contact list but cant read it in my inbox. when i recive it can be reciev and show hand incomming mail but while loading fining the mail i cant find in the inbox, Wander kneo who are the pro can help me up on this problem?
0
9734
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10664
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10417
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9220
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.