473,569 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mail error

Hi,
I'm having the folowing error :
Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
missing in c:\....filename

when I try to send a simple email using the folowing code:
mail(to******@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");

I'm running Appache/php/mySql,

Any help please?
Thanks

Jul 17 '05 #1
3 2584
toufik toufik wrote:
I'm having the folowing error :
Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
missing in c:\....filename

when I try to send a simple email using the folowing code:
mail(to******@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");

I'm running Appache/php/mySql,


You either have to install a mailserver or connect to Your mailprovider.

Maybe this helps:
http://www.phpbuilder.com/lists/php-...01102/0135.php

Rudi
Jul 17 '05 #2
toufik toufik wrote:
I'm having the folowing error :
Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
missing in c:\....filename

when I try to send a simple email using the folowing code:
mail(to******@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");

I'm running Appache/php/mySql,


You have to set up php.ini correctly.
According to the headers I think you're using Windows so the lines
to change in php.ini are "SMTP" and "sendmail_from" .

This script will tell you the current values of your configuration:

<?php
echo '<p>SMTP: ', ini_get('SMTP') , '</p>';
echo '<p>sendmail_fr om: ', ini_get('sendma il_from'), '</p>';
?>
If you just want one script to send mails you may want to try
reconfiguring just for that one

<?php
ini_set('SMTP', '<THE.MAIL.SERV ER.YOU.USE>'); // eg: mx.example.com
ini_set('sendma il_from', 'Y***********@T HE.MAIL.SERVER' ); // eg: me@example.com
// ...
// rest of the script
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #3
toufik toufik wrote:

I'm having the folowing error :
Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header
missing in c:\....filename

when I try to send a simple email using the folowing code:
mail(to******@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");


Try
mail(to******@h otmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3", "From:
yo**@address.co m")

Shawn
--
Shawn Wilson
sh***@glassgian t.com
http://www.glassgiant.com
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5459
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
5
1779
by: Eric Culus | last post by:
I seem to be having troubles with this page.... It's an automated mailing script... Steps: - system checks on x dates the variables linked to a maintenance contract (query on db) - when variable matches given element is queries the db again to retrieve the contact data linked to the maintenance system - I then sends an email to the...
9
3202
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on CDOmail. I don't want to use the Outlook reference because outlook prompts each time program access it and I have found a way to disable that. Can I...
1
8161
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I...
2
3482
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console application, and also succeeds from the asp.net page with BodyFormat=MailFormat.Text. I've recently upgraded from W2K SP4 to WinXP SP2 and am using .Net...
34
18188
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
2
12150
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used, error is thrown at the .send point. Error is: The following error occured Sending an email: System.ApplicationException: An error occurred sending...
2
6815
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how to fix this error. I am able to send messages sometimes both other times randomly following error appear EXCEPTION:
3
3379
by: digitaldiva | last post by:
Hi I am new here and once upon a time I worked with Perl, now I am trying again and need some help: I wrote a Perl script a few years ago that opened an order entry TXT file and sent each customer with an email address a confirmation email in html or txt. Simple enough and very effective. Now I am editing this script to send a general...
2
5869
mikek12004
by: mikek12004 | last post by:
Before posting here I google it and saw ablut 30 pages for a solution so I pretty much excluded the obvious things. The code is <?php //now to send the mails to seller require("class.phpmailer.php"); $mail = new PHPMailer(); //$mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "smtp.example.com"; // SMTP server...
0
7700
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...
0
7924
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. ...
0
8125
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...
1
7676
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...
0
7974
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...
1
5513
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...
0
3653
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...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
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

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.