473,785 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with mail function

118 New Member
hi,

i run the below code i got the below error when i run in my local system.And i placed same program in website it works fine.plz tell that what's the mistake in that.

[php]

<?php
$to ="aa@gmail.com" ;
$subject = "Site Registration Confirmation";
$message = '<html>
<head>
<title>Site Registration Confirmation</title>
</head>
<body style=font-family:verdana, arial; font-size: .8em;>
You filled out a registration form
<br/><br/>
</body>
</html>';
//headers type to sent the mail
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
// from address is take what ever we want
$from = "me@example.com ";
$headers .= "From: $from";
//mail function
mail($to,$subje ct,$message,$he aders);
?>

[/php]

error :Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header missing in e:\project\Data Mining\mailchec k.php on line 22
Jul 21 '08 #1
3 1477
ak1dnar
1,584 Recognized Expert Top Contributor
Please read about the mail function's additional header parameters here Good luck.
Jul 21 '08 #2
neetendra
1 New Member
First of all you go to php.ini and change the "sendmail_f rom" to your email id.... and want to more about plz click http://in.php.net/function.mail
Jul 22 '08 #3
Atli
5,058 Recognized Expert Expert
The highlights of which would be that the additional headers must include a From header, whether that is set in the additional_head ers parameter or via the php.ini directive.
Jul 23 '08 #4

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

Similar topics

5
3108
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 Windows Update which I do regularly. The only part of this update that might be related was an IE 6 update. So I uninstalled and reinstaled PHP 4.3.3. The mail server setting is correct in the php.ini file. But email is still not being sent. ...
2
2449
by: S_p_ike | last post by:
Hi all, I have a problem with mail with attachments. To send e-mail with attachments from a form, I use Setec Astronomy's libmail class (v 1.4) (available here http://www.phpclasses.org/) Everything is ok but if I use a specific e-mail address (say address X) in the field To, the e-mail arrives without attachments. (even if I use two addresses for field To, of which one is address X, the mail to address X arrives without attachments,...
7
1791
by: Rafal Zawadzki | last post by:
Hello again. Mail() function in my php doesn't work. I've got very simple script: <? mail("bluszcz@jabberpl.org","Test","Test"); ?>
15
3318
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false;
1
2266
by: John | last post by:
Hi First of all apologies for posting so much code but this is rather involved and I am totally stumped. Basically I have a main form (Staff Batch SMS/E-Mail) which calls a function (SendSMS) in a module with in turn calls a form (frmInet) which contains an ms internet control (Inet1). Problem is that once the function Send SMS returns and the code tries to close the main form a 'Runtime error 2486: You can't carry out this action at...
3
1624
by: Bart Stes | last post by:
Hey guys, I'm try to write a very simple winform app that allows the users to send an email. I use the System.Web.Mail MailMessage class for this. But when it comes to adding an attachment, something appears to go wrong. After I execute the following code, the MailMessage appears to have an attachment (looked it up through a watch in debug mode), but when I actually send the message, the attachment is not send along with it. So the...
1
3895
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 = New DirectoryEntry("LDAP://domain") Dim mySearcher As New DirectorySearcher(enTry) Dim resEnt As SearchResult mySearcher.Filter = ("(objectClass=*)") mySearcher.SearchScope = SearchScope.Subtree
4
6133
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 strbody=strbody +"dear customer,\n"; strbody=strbody +"we are glad to see ur response\n"; strbody=strbody +"we will make the needful thing as early as possible\n";
2
3012
by: Mitul | last post by:
Hello Friend, I am having very strange problem with mail function. As I have to implement Newsletter things in my hebrew site. I have implemented everything but having problem with subject line is not display on any one of mail services. Mail display body part properly in hebrew but subject line having problem its display junk character in subject. I am not able figure out what is the actual problem. Please help me for this matter.
0
1574
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. unfortunately, no error message is given by the system. <?php class Mail_Tabelle extends Mail_DB { protected $description = false; const TBL_HEAD = ' <thead>
0
10356
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...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
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,...
1
7509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4061
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
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
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.