# Use sendmail without mentioning From:

**URL:** <https://community.unix.com/t/use-sendmail-without-mentioning-from/366374>\
**Category:** Shell Programming and Scripting\
**Created:** [May 2, 2017, 4:19am UTC](https://community.unix.com/t/use-sendmail-without-mentioning-from/366374 "2017-05-02T04:19:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohtashims](https://community.unix.com/letter_avatar/mohtashims/32/6_449c533f586939b6e5f246632a46421f.png) [@mohtashims](https://community.unix.com/u/mohtashims)\
**Post date:** [May 2, 2017, 4:19am UTC](https://community.unix.com/t/use-sendmail-without-mentioning-from/366374/1 "2017-05-02T04:19:54Z")

</div>

Hi,

Here is my sendmail script.

```plaintext
#!/bin/ksh
{
# print "From: user1@`hostname`" 
        print "To: me@mycomp.com"
} | /usr/sbin/sendmail -t

```

I wish to use sendmail without having to specify `# print "From: user1@`hostname`" ` so that it picks or formulates the default value of From: which is in most cases the

> [@](#):
>
> username@hostname

Can you help tweak the script to default the From: aspect ?

Operating System: SunOS.

---

<div class="post-metadata">

**Author:** ![Yoda](https://community.unix.com/user_avatar/community.unix.com/yoda/32/2498_2.png) [@Yoda](https://community.unix.com/u/Yoda)\
**Post date:** [May 3, 2017, 12:13pm UTC](https://community.unix.com/t/use-sendmail-without-mentioning-from/366374/2 "2017-05-03T12:13:40Z")

</div>

Unlike `To:` it is not mandatory to specify `From:`
