Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 135,919 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,582 people online right now. Registration is fast and FREE... Join Now!




PHP mail function

 
Reply to this topicStart new topic

PHP mail function, Problem with config file

Clearman
19 May, 2008 - 12:01 PM
Post #1

New D.I.C Head
*

Joined: 13 Dec, 2007
Posts: 48


My Contributions
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:
CODE

[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 - 03:17 PM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: PHP Mail Function
19 May, 2008 - 03:32 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,433



Thanked: 64 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
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
User is offlineProfile CardPM
+Quote Post

Clearman
RE: PHP Mail Function
19 May, 2008 - 04:06 PM
Post #3

New D.I.C Head
*

Joined: 13 Dec, 2007
Posts: 48


My Contributions
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.com/software/email-apps/...rver-111166.php
https://mail.google.com/support/bin/answer.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 - 05:23 PM
User is offlineProfile CardPM
+Quote Post

mindstorms6
RE: PHP Mail Function
25 May, 2008 - 08:40 PM
Post #4

New D.I.C Head
*

Joined: 25 May, 2008
Posts: 5

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


CODE
include_once(send.php);


and the call the function

CODE
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)
Attached File  send.php ( 1.18k ) Number of downloads: 38
Attached File  class.smtp.php ( 31.84k ) Number of downloads: 33
Attached File  class.pop3.php ( 9.41k ) Number of downloads: 36
Attached File  class.phpmailer.php ( 49.05k ) Number of downloads: 30
User is offlineProfile CardPM
+Quote Post

Clearman
RE: PHP Mail Function
31 May, 2008 - 03:09 PM
Post #5

New D.I.C Head
*

Joined: 13 Dec, 2007
Posts: 48


My Contributions
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 - 03:22 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:03AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month