#1 (permalink)  
Old 06-30-2009, 11:14 AM
Registered User
 
Join Date: Oct 2005
Location: /local/bar
Posts: 5
Datacenter1.com is on a distinguished road
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 )
__________________
Datacenter1.com
Servidores Dedicados - VPS 100% Uptime - Excelentes Precios
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-30-2009, 12:37 PM
Registered User
 
Join Date: Jul 2005
Location: New Jersey, USA
Posts: 385
PlatinumServerM is on a distinguished road
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.";
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-30-2009, 01:26 PM
Registered User
 
Join Date: Oct 2005
Location: /local/bar
Posts: 5
Datacenter1.com is on a distinguished road
Quote:
Originally Posted by PlatinumServerM View Post
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.";
?>
Thank you PlatinumServerM, I already know that

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
__________________
Datacenter1.com
Servidores Dedicados - VPS 100% Uptime - Excelentes Precios
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add email address using linux command line classywear Mail 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


All times are GMT -5. The time now is 01:31 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc