# Sending an e-mail through a function

**URL:** <https://forum.kirupa.com/t/sending-an-e-mail-through-a-function/249529>\
**Category:** programming\
**Created:** [January 19, 2008, 7:13pm UTC](https://forum.kirupa.com/t/sending-an-e-mail-through-a-function/249529 "2008-01-19T19:13:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamerp](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dreamerp](https://forum.kirupa.com/u/dreamerp)\
**Post date:** [January 19, 2008, 7:13pm UTC](https://forum.kirupa.com/t/sending-an-e-mail-through-a-function/249529/1 "2008-01-19T19:13:04Z")

</div>

Hello,

I am using PHP to send e-mail to people who subscribe to other users posting content. I call the function and it retrieves the e-mails which have subscribed to this user who has posted something.

Then I use the mail() function however it will not work when I try to put headers on the e-mail such as the From or Reply-To header.

Any ideas? I have already tested the mail and it works outside of the function.

Thanks
