Hello!
I'm trying to send an email to my yahoo adress, using function mail(), as follows:
Quote:
<?php
$to = "my_adress@yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
if (@mail($to, $subject, $message)) {
echo('<p>Mail sent successfully.</p>');
}
else {
echo('<p>Mail could not be sent.</p>');
}
?>
|
I'm using XAMPP (/opt/lampp).
I've installed sendmail from Synaptic Package Manager (I'm using Ubuntu 9.04).
The message shown in the web page is "Mail sent successfully." (after almost one minute of not displaying anything), but there is no new mail in my yahoo mailbox. I don't know how to configure sendmail and /opt/lampp/etc/php.ini properly.
When I try to send mail via Terminal (command line), again, it takes a lot of time (almost one minute) and the message is not send. I've got the following errors in the log files from /var/log/mail.err:
Code:
Jul 24 17:31:23 andrei-laptop sendmail[1646]: My unqualified host name (andrei-laptop) unknown; sleeping for retry
Jul 24 17:32:23 andrei-laptop sendmail[1646]: unable to qualify my own domain name (andrei-laptop) -- using short name
Jul 24 17:32:23 andrei-laptop sm-mta[1740]: My unqualified host name (andrei-laptop) unknown; sleeping for retry
Jul 24 17:32:25 andrei-laptop sm-msp-queue[1745]: My unqualified host name (andrei-laptop) unknown; sleeping for retry
Jul 24 17:33:23 andrei-laptop sm-mta[1740]: unable to qualify my own domain name (andrei-laptop) -- using short name
Jul 24 17:33:45 andrei-laptop sm-msp-queue[1745]: unable to qualify my own domain name (andrei-laptop) -- using short name
or in /var/log/mail.log
Code:
Jul 24 17:48:19 andrei-laptop sendmail[3128]: My unqualified host name (andrei-laptop) unknown; sleeping for retry
Jul 24 17:48:36 andrei-laptop sendmail[3101]: unable to qualify my own domain name (andrei-laptop) -- using short name
Jul 24 17:48:36 andrei-laptop sendmail[3101]: n6OEma83003101: from=andrei, size=87, class=0, nrcpts=1, msgid=<200907241448.n6OEma83003101@andrei-laptop>, relay=andrei@localhost
Jul 24 17:48:37 andrei-laptop sm-mta[3142]: n6OEmaNe003142: from=<andrei@andrei-laptop>, size=344, class=0, nrcpts=1, msgid=<200907241448.n6OEma83003101@andrei-laptop>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul 24 17:48:37 andrei-laptop sendmail[3101]: n6OEma83003101: to=my_adress@yahoo.com, ctladdr=andrei (1000/1000), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30087, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n6OEmaNe003142 Message accepted for delivery)
Jul 24 17:48:42 andrei-laptop sm-mta[3144]: n6OEmaNe003142: to=<my_adress@yahoo.com>, ctladdr=<andrei@andrei-laptop> (1000/1000), delay=00:00:05, xdelay=00:00:05, mailer=esmtp, pri=120344, relay=e.mx.mail.yahoo.com. [216.39.53.1], dsn=5.0.0, stat=Service unavailable
Jul 24 17:48:42 andrei-laptop sm-mta[3144]: n6OEmaNe003142: n6OEmgNe003144: DSN: Service unavailable
Jul 24 17:48:42 andrei-laptop sm-mta[3144]: n6OEmgNe003144: to=<andrei@andrei-laptop>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
Sorry for adding so much text here...
Now, the most important, here is a section of my /opt/lampp/etc/php.ini file.. which way should I change it?
Code:
[mail function]
; For Win32 only.
SMTP = localhost
;smtp_port = 25 ?should this be uncommented?--------------------
; For Win32 only.
sendmail_from = my_adress@yahoo.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/lib/sm.bin/sendmail -t
By the way, there is sendmail, in /usr/lib/sm.bin/sendmail.
I also have the httpd.conf file in /opt/lampp/etc, which is quite important in server's configuration.
so, a part of httpd.conf:
Code:
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin you@example.com
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
# XAMPP
ServerName localhost
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/home/andrei/Public"
I hope someone could help. Any advice is welcome.
Thank you very much!