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

mail error

Hi,
I'm having the folowing error :
Warning: mail(): "sendmail_from" 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******@hotmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");

I'm running Appache/php/mySql,

Any help please?
Thanks

Jul 17 '05 #1
3 2579
toufik toufik wrote:
I'm having the folowing error :
Warning: mail(): "sendmail_from" 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******@hotmail.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_from" 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******@hotmail.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_from: ', ini_get('sendmail_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.SERVER.YOU.USE>'); // eg: mx.example.com
ini_set('sendmail_from', 'Y***********@THE.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_from" 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******@hotmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");


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

Shawn
--
Shawn Wilson
sh***@glassgiant.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
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 -------------------------------------------------------------------------------- ...
5
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...
9
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...
1
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...
2
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...
34
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...
2
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,...
2
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...
3
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...
2
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...

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.