|
|||
|
Sending email to customers from command line
Hi,
I'm writing a little script to automatic suspend resource abusers (cpu, mysql & memory) but I want to sent an email to the customer when the account is suspended, how can I do that? Is there a way to sent an email from command line to user X (X is a cpanel account off course )
|
|
|||
|
You can use a simple mail routine in either perl or php.
<?php $to = "someone@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@example.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> |
|
|||
|
Quote:
My question is how to sent an email from command line, when the only thing I have is the customer's username, or in other words, how can I get the user's email address from his username? Thank You |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add email address using linux command line | classywear | 6 | 08-27-2009 11:37 AM | |
| command line commands - creating and setting up a quota to an email address | cteinternet | cPanel and WHM Discussions | 5 | 07-09-2009 03:12 PM |
| email from php or command line not working | redlorry919 | cPanel and WHM Discussions | 0 | 02-06-2006 03:47 PM |
| Problem sending email to new customers john@hisdomain.com wh | AbeFroman | cPanel and WHM Discussions | 1 | 05-17-2002 06:57 AM |