473,404 Members | 2,137 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,404 software developers and data experts.

Problem occure in the mail() function

Hi,

I run the following code error will occure. Plz tell that what mistake i have done
[php]<?php
// multiple recipients
$to = 'sravani_409@yahoo.com' . ', '; // note the comma
$to .= 'jyothsna11_123@yahoo.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: Mary <vani@eminosoft.com>, Kelly <sravanik@eminosoft.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <jyothsna11.123@gmail.com>' . "\r\n";
$headers .= 'Cc: soundarya_435@yahoo.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>[/php]
error :Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\wamp\www\mail1.php on line 43
Mar 20 '08 #1
4 1473
ronverdonk
4,258 Expert 4TB
This is the third and last warning.

Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
Mar 20 '08 #2
Ramu528
18
Hi,

I run the following code error will occure. Plz tell that what mistake i have done
[php]<?php
// multiple recipients
$to = 'sravani_409@yahoo.com' . ', '; // note the comma
$to .= 'jyothsna11_123@yahoo.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: Mary <vani@eminosoft.com>, Kelly <sravanik@eminosoft.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <jyothsna11.123@gmail.com>' . "\r\n";
$headers .= 'Cc: soundarya_435@yahoo.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>[/php]
error :Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\wamp\www\mail1.php on line 43
Hi Sravani,

Its an SMTP error. contact ur system administrator to set the settings of your server which u r using. SMTP u have to set an default emailid too. Default IP has to be changed.
All the Best,
Ramu
Hyderabad
Mar 20 '08 #3
ak1dnar
1,584 Expert 1GB
Hi Sravani,

Its an SMTP error. contact ur system administrator to set the settings of your server which u r using. SMTP u have to set an default emailid too. Default IP has to be changed.
All the Best,
Ramu
Hyderabad
I think he is using his local windows machine, So System Administrator?

@Original Poster
Hi, just check your php.ini file for smtp settings. you have to use a real SMTP server IP/host and a port to send mails from your local machine. if you need more info on this please post back. thanks
Mar 20 '08 #4
ronverdonk
4,258 Expert 4TB
I think he is using his local windows machine, So System Administrator?

@Original Poster
Hi, just check your php.ini file for smtp settings. you have to use a real SMTP server IP/host and a port to send mails from your local machine. if you need more info on this please post back. thanks
Probably quicker and easier to show (only) the mail and SMTP settings in your PHP.INI file here.

Ronald
Mar 20 '08 #5

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

Similar topics

5
by: Bruce W...1 | last post by:
In my effort to learn PHP I'm playing with some simple email scripts. They worked a few days ago but they stopped working. The only thing I've done to this Windows 2000 PC in this time was a...
6
by: Tom | last post by:
I try to write a simple tcp based job queue server. It's purpose is to get commands from a client and store them in a queue (STL). The server has a thread which checks periodically the queue,...
1
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
8
by: BBC1009 | last post by:
I have an application connected to an overseas sql-server using port 1433. But recently it always timeout the connection. Any solution to avoid this??? I am using the VB.net Windowed Form with...
4
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet ...
3
by: MariyaGel | last post by:
I have wrote the program and it worked fine until I had to include one more array into it. As you can see below the two arrays of volume and mass are working properly now I need to include a third...
0
Dormilich
by: Dormilich | last post by:
this is a follow-up thread to this one. http://bytes.com/topic/html-css/answers/863662-form-not-submitted-sometimes I figured out that the mail sending class triggers the described error....
1
by: shahidrasul | last post by:
i want to download a file which user select from gridview, downloading is completing without problem but after download i want to refresh my page because i do some changes in db . but when...
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.