Connecting Tech Pros Worldwide Help | Site Map

Using mail()

Nick Mudge
Guest
 
Posts: n/a
#1: Jul 17 '05
I am trying to use the mail() function in my PHP script, but when I run the
script, nothing happens. I am using Windows XP with Apache. I have the
current versions of PHP 4, Apache 2, and MySQL.

I think I might have to make a configuration in my php.ini file to point to
the sendmail program or something. I don't know how to do that. Does
anybody think they can help me with this?

I want to be able to write a page that has a form, and then when the person
fills the form and submits it, it gets emailed to me.


Nick


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>

<base target="right">
<title>Comment</title>
</head>

<body>

<?php

$comment = $_POST['comment'];

$email = $_POST['email'];

$toaddress = 'mudgen@operamail.com';
$subject = 'Cool';
$mailcontent = $comment;
$fromaddress ='From: mark1822@hotmail.com';

mail($toaddress, $subject, $mailcontent);
?>
</body>
</html>


Garp
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Using mail()



"Nick Mudge" <mark1822@hotmail.com> wrote in message
news:LyHkc.2234$Ia6.285084@attbi_s03...[color=blue]
> I am trying to use the mail() function in my PHP script, but when I run[/color]
the[color=blue]
> script, nothing happens. I am using Windows XP with Apache. I have the
> current versions of PHP 4, Apache 2, and MySQL.
>
> I think I might have to make a configuration in my php.ini file to point[/color]
to[color=blue]
> the sendmail program or something. I don't know how to do that. Does
> anybody think they can help me with this?[/color]

In PHP.INI:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only. You may supply arguments as well (default:
'sendmail -t -i').
;sendmail_path =

HTH
Garp


Nick Mudge
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Using mail()


My php.ini is set up that way, and it still doesn't work, does anybody have
any suggestions?


"Garp" <garp7@no7.blueyonder.co.uk> wrote in message
news:G2Ikc.1893$ia4.17447100@news-text.cableinet.net...[color=blue]
>
> "Nick Mudge" <mark1822@hotmail.com> wrote in message
> news:LyHkc.2234$Ia6.285084@attbi_s03...[color=green]
> > I am trying to use the mail() function in my PHP script, but when I run[/color]
> the[color=green]
> > script, nothing happens. I am using Windows XP with Apache. I have the
> > current versions of PHP 4, Apache 2, and MySQL.
> >
> > I think I might have to make a configuration in my php.ini file to point[/color]
> to[color=green]
> > the sendmail program or something. I don't know how to do that. Does
> > anybody think they can help me with this?[/color]
>
> In PHP.INI:
>
> [mail function]
> ; For Win32 only.
> SMTP = localhost
>
> ; For Win32 only.
> sendmail_from = me@localhost.com
>
> ; For Unix only. You may supply arguments as well (default:
> 'sendmail -t -i').
> ;sendmail_path =
>
> HTH
> Garp
>
>[/color]


Pedro Graca
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Using mail()


Nick Mudge top-posted [corrected]:[color=blue]
> "Garp" <garp7@no7.blueyonder.co.uk> wrote in message
> news:G2Ikc.1893$ia4.17447100@news-text.cableinet.net...[color=green]
>> In PHP.INI:
>>
>> [mail function]
>> ; For Win32 only.
>> SMTP = localhost
>>
>> ; For Win32 only.
>> sendmail_from = me@localhost.com[/color][/color]
[color=blue]
> My php.ini is set up that way, and it still doesn't work, does anybody have
> any suggestions?[/color]

[mail function]
SMTP = mx3.hotmail.com
sendmail_from = mark1822@hotmail.com


But I believe hotmail does not allow you to use its SMTP service.
Configure the SMTP server to the same server you have for your mail
program and use the sender as your address there.

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Nick Mudge
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Using mail()


Thanks a lot.

SMTP = mx3.hotmail.com
sendmail_from = mark1822@hotmail.com

Worked.

"Pedro Graca" <hexkid@hotpop.com> wrote in message
news:c70p6h$gvbie$1@ID-203069.news.uni-berlin.de...[color=blue]
> Nick Mudge top-posted [corrected]:[color=green]
> > "Garp" <garp7@no7.blueyonder.co.uk> wrote in message
> > news:G2Ikc.1893$ia4.17447100@news-text.cableinet.net...[color=darkred]
> >> In PHP.INI:
> >>
> >> [mail function]
> >> ; For Win32 only.
> >> SMTP = localhost
> >>
> >> ; For Win32 only.
> >> sendmail_from = me@localhost.com[/color][/color]
>[color=green]
> > My php.ini is set up that way, and it still doesn't work, does anybody[/color][/color]
have[color=blue][color=green]
> > any suggestions?[/color]
>
> [mail function]
> SMTP = mx3.hotmail.com
> sendmail_from = mark1822@hotmail.com
>
>
> But I believe hotmail does not allow you to use its SMTP service.
> Configure the SMTP server to the same server you have for your mail
> program and use the sender as your address there.
>
> --
> USENET would be a better place if everybody read: : mail address :
> http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
> http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
> http://www.expita.com/nomime.html : to 10K bytes :[/color]


Closed Thread