PHP mail function

Problem with config file

Page 1 of 1

4 Replies - 4567 Views - Last Post: 31 May 2008 - 04:09 PM Rate Topic: -----

#1 Clearman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 13-December 07

PHP mail function

Post icon  Posted 19 May 2008 - 01:01 PM

Error
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\wamp\www\index.php on line 6
The email(Test E-Mail (This is the subject of the E-Mail)) was NOT sent.

Dose any one know how to set up the php.ini file i change it to this:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = myemail@gmail.com;this is all i changed.

; 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 =



but i still get the same error.

Still looking it up but cant find much.

any ideas?

This post has been edited by Clearman: 19 May 2008 - 04:17 PM


Is This A Good Question/Topic? 0
  • +

Replies To: PHP mail function

#2 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5234
  • View blog
  • Posts: 27,025
  • Joined: 10-May 07

Re: PHP mail function

Posted 19 May 2008 - 04:32 PM

If you are going to set these options in your php.ini, then you need to point them to your email server. You can not (or at least, should not) simply forge your email headers to match your gmail email address. Chances are, most email servers will drop the email & it is going to be tagged as spam with forged headers.

php.net
Was This Post Helpful? 0
  • +
  • -

#3 Clearman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 13-December 07

Re: PHP mail function

Posted 19 May 2008 - 05:06 PM

Thank you i will look around for one.

Is there any way i can set this up so i don't have to set up a mail server?
or mandatory with the mail server.
http://lifehacker.co...rver-111166.php
https://mail.google....py?answer=13273

new error and hopefully last:
SMTP server response: 551 User not local. We don't relay in C:\wamp\www\index.php

This post has been edited by Clearman: 19 May 2008 - 06:23 PM

Was This Post Helpful? 0
  • +
  • -

#4 mindstorms6  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 25-May 08

Re: PHP mail function

Posted 25 May 2008 - 09:40 PM

yep. I do it now. I use gmail to send stuff all the time. basically, there is a script that i found, and i'll look for the source, but I forget where it came from. but here it is.

basically, in any page i need to send mail on, i just


include_once(send.php);


and the call the function

send("Body", "address@somewhere.com");


but of course you'll need the edit the send function with your password and username and whatnot...... and you can edit that function. i just keep the rest of those vars the same.

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#5 Clearman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 13-December 07

Re: PHP mail function

Posted 31 May 2008 - 04:09 PM

Thanks mate it took me 2 minutes to set that up your a life saver.

This post has been edited by Clearman: 31 May 2008 - 04:22 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1