/    Sign up×
Community /Pin to ProfileBookmark

php mail problem

OK, well I’m just learning php, and wanted to just write a simple mail script, so I found the mail function. So in my php file I have:

<?php mail(“my email address”, “testing”, “Testing 123”, “From: my email address”);?>

Obviously my email address is replaced by my actual email address.

When I run this I get:

Warning: mail(): “sendmail_from” not set in php.ini or custom “From:” header missing in phpfilepath on line 10

where phpfilepath is the actual path to my php file. First off I figured only having the from paramater would work and I wouldn’t need to touch the php.ini file, but just for fun I went in and changed it to this

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

; For Win32 only.
sendmail_from = my email address

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

So I satisfied both criteria when I should have only needed one, yet I got the same error again. Can anyone see what I’m doing wrong?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @zachvac spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...