hello every one, i need help..
how can i use the mail() funtion in php? when ever i execute the mail function i continuesly receive this error message:
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...
what do i need to do in order for me to connect with my localhost mailserver?
can anyone help me with this?
thanks in advance..(^_^)
--nert
13 21297
hello every one, i need help..
how can i use the mail() funtion in php? when ever i execute the mail function i continuesly receive this error message:
what do i need to do in order for me to connect with my localhost mailserver?
can anyone help me with this?
thanks in advance..(^_^)
--nert
Just do what the message says. Look in your PHP.INI for the SMTP, port and (If Windows) for the settings: - ; For Win32 only.
-
SMTP = ??????
-
smtp_port = 25
-
-
; For Win32 only.
-
sendmail_from = ???
-
-
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
-
;sendmail_path =
Ronald :cool:
well i have a similar problem
i downloaded this code from a tutorial website, and save it on
c:\apache\htdocs\testsendemail\index.php
this is the code that i downloaded: -
<?php
-
-
//Check whether the submission is made
-
if(isset($hidSubmit)){
-
-
//Declarate the necessary variables
-
$mail_to=$txtEmailto;
-
$mail_from=$txtEmailfrm;
-
$mail_sub=$txtSub;
-
$mail_mesg=$txtMsg;
-
-
//Check for success/failure of delivery
-
if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from"))
-
echo "<span class='textred'>E-mail has been sent successfully from $mail_sub to $mail_to</span>";
-
else
-
echo "<span class='textred'>Failed to send the E-mail from $mail_sub to $mail_to</span>";
-
}
-
?>
-
||||
||||
||||
||||
||||
this is the warning message that i received:
Warning: Failed to Connect in c:\apache\htdocs\testsendemail\index.php on line 13
Failed to send the E-mail from to
what should i do?
sorry i'm a total newbie here, just started to learn how to use php.
hi,
i tried this stuff, but i still recieve the same error message.., am i missing something Sir? - ; For Win32 only.
-
SMTP = localhost
-
smtp_port = 25
-
-
; For Win32 only.
-
sendmail_from = localhost
-
-
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
-
;sendmail_path =
--nert
hi,
i tried this stuff, but i still recieve the same error message.., am i missing something Sir?
--nert
Does that mean that you have actually changed the PHP.INI settings to your own situation, saved it in C:\WINDOWS\ and it still does not run?
Then show us these lines you have made in PHP.INI.
Ronald :cool:
Does that mean that you have actually changed the PHP.INI settings to your own situation, saved it in C:\WINDOWS\ and it still does not run?
Then show us these lines you have made in PHP.INI.
Ronald :cool:
hi,
i'm sorry sir this is just the first time i use the php mail function, and i don't have any idea about what configuration this function need in order to work.
is this right sir?(^_^)
[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In
; runtime, you can define these variables by calling define_syslog_variables().
define_syslog_variables = Off
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = localhost
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
can i add another question sir?
i don't even know how to configure smtp i tried to follow the instruction i found from an article in the internet, but don't know if my smtp really working know. Sir how do i know whether its really working?
In order to use the mail() function you must have setup the php.ini parameters correctly.
This means that you have to define in your php.ini:
the name of the SMTP server. If you do not have your own SMTP server or your provider does not provide an SMTP server to you, you could specify the mail server that is attached to your standard email address, like smtp.mysite.com or alike.
you can use an address at your SMTP server address, in a situation as abobe, uou could use your own email address here.[/code]
Try it out and see if this setup works for you,
Ronald :cool:
Seeing your reply, which is the exact copy of your earlier post, and therefore removed, you do not quite understand what must be done.
In order to use the mail function, you must configure some parameters in the php.ini file, that should be located in your C:\WINDOWS directory.
The specific configuration directives for Windows are: - SMTP=
host name or IP address of the SMTP server PHP should use for mail sent with the mail() function.
I use my email provider's server for that. You can do same and specify something like SMTP=mail.myprovider.com (just an example!)
- smtp_port=
Usually defaults to 25, leave it 25.
- sendmail_from=
"From:" mail address should be used in mail sent from PHP under Windows.
So you could define your own email adddress here.
If you want more and a better explanation of these directives, refer to the php manual on mail() at PHP Mail functions
And last: I am not Sir, my name is Ronald.
Ronald :cool:
What about if the port is different than 25?
Still the function will work?
Thanks
What about if the port is different than 25?
Still the function will work?
Thanks
amorgos: you asked that already in a separate thread! Don't pollute this thread.
Ronald :cool:
Ronald,
I am also looking for a solution for sending mail from forms using PHP in Windows. I researched your replies to the previous person and checked my PHP.ini and code to see if it complied with your instructions. It does comply and I and getting the error: "Warning: mail() {function.function]: smpt DERVER RESPONSE:530 AUTHENTICATION REQUIRED - FOR HELP GO TO HTTP://HELP.YAHOO.COM/HELP/US/SBC/CL...OP/POP-11.HTML IN d:\iNTERNET\aPACHED2.2\HTDOCS\MYSITE\messageSent.p hp on line 8.
The error points to my code on line 8 of the messageSent.php code:
Code goes here:
[code]
<?php
$to = "yourname@yourserver.com";
$subject = "This is the message subject";
$body = "this is the message body";
$headers = "From: yourname@yourserver.com\n";
mail($to,$subject,$body,$headers); ; this is line 8 of the code
?>
when the code attempts to send the message to my ISP's smtp server, the smtp server refuses the message because , I believe that there is no authentication set for it to use my isp's smtp server.
I use Yahoo and when I went to HTTP://HELP.YAHOO.COM/HELP/US/SBC/CLSL/MAIL/POP/POP-11.HTML,
I found that Yahoo only accepts certain email clients and Yahoo lists them.
There is also some discussion about paying for access to a smpt server, if you wish to send mail from your own site. I may be reading something wrong and I am looking for second opinions and some direction. Can anyone else provide some insight regarding how Yahoo or other ISPs handle this issue.
This may be why so many people are failing to be able to use smtp from their local host servers.
This is code from my PHP.ini file: -
[mail function]
-
; For Win32 only.
-
SMTP = smtp.pacbell.yahoo.com
-
smtp_port = 25
-
-
; For Win32 only.
-
;sendmail_from = me@pacbell.net
-
-
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
-
;sendmail_path =
-
-
; Force the addition of the specified parameters to be passed as extra parameters
-
; to the sendmail binary. These parameters will always replace the value of
-
; the 5th parameter to mail(), even in safe mode.
-
;mail.force_extra_parameters =
-
This is the code from my form: -
<td><form id="form2" name="form2" method="post" action="">
-
<textarea name="body" cols="55" id="body"></textarea>
-
</form> </td>
-
</tr>
-
<tr>
-
<td> </td>
-
<td><form id="form3" name="form3" method="post" action="">
-
<input type="submit" name="Submit" value="Submit" />
-
</form> </td>
-
</tr>
-
The form and this code work well. My ISP seems to refuse to take messages from outside servers and or email clients other than those listed in the help page.
Is their a work around for this?
Why is everyone hijacking this thread?
Anyway, the simplest way to send mail using SMTP is to use SwiftMailer. It is very easy to use, extremely object-oriented, and has it's own support board at DevNetwork.
Why is everyone hijacking this thread?
Anyway, the simplest way to send mail using SMTP is to use SwiftMailer. It is very easy to use, extremely object-oriented, and has it's own support board at DevNetwork.
Thanks for the information. I will try Swiftmailer.
sorry to use this thread, but its relavant to my problems, you see, therea a forum on my webite that is SUPPOSED to send me an email verification whenever someone posts a new thread, but it dosnt work.
heres the error: - Warning: mail() [function.mail]: Safety Restriction in effect. The mail() command is not allowed, contact the admin. in /forums/mboard.php on line 470
this file can be found at here Sign in to post your reply or Sign up for a free account.
Similar topics
by: Geoff Soper |
last post by:
I'm using the mail() function to send e-mails. The first argument to the
function is the e-mail address the mail will be sent to. I understand this
should just be in the format 'address@domain' and...
|
by: Web Master |
last post by:
Hi,
I am having a little issue with Jacks Form mail php script. I have
installed it and configured the form to get it to work, but for some
bizarre reason I have 2 issues I can't seem to debug....
|
by: Jim Seymour |
last post by:
I have a contact form that uses PHP's mail() function. It recently
came to my attention that (some?) MS-Windows mail servers may not
properly process data given to the mail() function that's only...
|
by: Groupe Eurower |
last post by:
Hi,
I would like contribute to the PHP development but i don't really know where
i can submit my codes !
In fact, i'm a Web Hosting and i authorize the utilisation of the mail()
function.
...
|
by: Karuna |
last post by:
Hi everybody,
I have been trying to write a simple mail script using PHP and apache
on Windows XP. Eventhough the script is saying that the mail is
successfully sent, I am unable get it in my...
|
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
--------------------------------------------------------------------------------
...
|
by: uranuskid |
last post by:
Hey folks,
I was going to include a contact form on my website. Well, in the first place that seemed an easy thing to do with a form that prompts a PHP file validating the input vaiables and using...
|
by: Ruud |
last post by:
Just before leaving for a holiday my collegue modified this script.
Now it won't send any body text (The data filled in on the form) and
in an error condition it won't send any attachments either....
|
by: maxxxxel |
last post by:
Hi
Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine.
Our problem is that when we send...
|
by: mukeshrasm |
last post by:
Hi I am no able to send mail and it is giving this error
Warning: mail(): SMTP server response: 530 5.7.3 Client was not authenticated in c:\inetpub\wwwroot\eshop\includes\classes\email.php on...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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...
|
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,...
|
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: 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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |