Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    26

    Default Sendmail by command line in Cpanel

    Hi everybody!

    Cpanel uses Exim for sending/receiving email
    I have a bash shell that auto send mail to us by common command like this:
    Code:
    #!/bin/sh
    
    (
    action
    ) | /bin/mail -s 'My subject' my@email.com
    But now, I use "exim" command to test but it requires more typing and i don't know how to put all in one shell scripts.

    Code:
    exim -v -odf my@email.com
    My subject
    .
    Successfully......

    Anybody can edit this command for scripts?

    Thanks very much

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Sendmail by command line in Cpanel

    Why are you attempting to send using exim odf specifically, since sendmail way will work? exim is used for debugging purposes, and unless your script is to test exim working, I'm uncertain why you would be attempting to use this for sending via your test script. Please explain the purpose.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Jun 2011
    Posts
    26

    Default Re: Sendmail by command line in Cpanel

    Hi Tristan!

    My purpose is very simple, i only want to send mail from Cpanel system to outgoing mail account with a notification.
    I try the old script but it doesn't work, so i think, Exim has override sendmail binary, so i try Exim and see that it can send mail by those command!
    Now you have any idea for my work?

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Sendmail by command line in Cpanel

    From command line, this works:

    Code:
    /bin/mail -s 'Subject' email@domain.com < /dev/null
    You might want to modify your code to ensure it terminates properly. Otherwise, you can review this discussion on using sendmail:

    Kangry.com: sendmail command line with subject example linux
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  5. #5
    Member
    Join Date
    Jun 2011
    Posts
    26

    Default Re: Sendmail by command line in Cpanel

    Thanks Tristan!

    I knew my problem!

    Thanks again!

Similar Threads & Tags
Similar threads

  1. how to restart apache trough cpanel command line?
    By charliesxia in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 09-16-2011, 10:03 AM
  2. MySQL db through command line and cpanel
    By meeven in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-27-2008, 10:02 PM
  3. Cpanel backup from command line
    By Radio_Head in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 05-30-2007, 04:48 PM
  4. restart whm/cpanel from command line
    By fuzzymonkey in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-16-2004, 01:01 PM
  5. What is the command to restart cpanel via the command line?
    By AbeFroman in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-29-2004, 03:24 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube