Re: Running a script in remote computer (226 Views)
Reply
Occasional Advisor
pradpaul2000
Posts: 12
Registered: ‎04-27-2011
Message 1 of 7 (262 Views)

Running a script in remote computer

Hi,

 

Here I am trying to check the smtp server sending email on a remote server requests. Here I am planning to run a script in the remote server. But how could I confirm, whether the smtp has send the mail successfully. experts please help.

 

 

Honored Contributor
Sujith Kumar C.S
Posts: 871
Registered: ‎04-07-2010
Message 2 of 7 (259 Views)

Re: Running a script in remote computer

I have not done this before but I will try to help. You can use the mail monitor or create a batch file which has the commands to test the SMTP server and use script monitor to execute the script.

 

Telnet to Port 25 to Test SMTP Communication

 

More info: http://support.microsoft.com/kb/153119

 

Port 25 is the default port for SMTP. So you can also configure port monitor on this port to ensure that the server is able to accept requests. A service monitor to check POP3 service should also help you.

 

--Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Occasional Advisor
pradpaul2000
Posts: 12
Registered: ‎04-27-2011
Message 3 of 7 (251 Views)

Re: Running a script in remote computer

Hi,

 

By using the mail monitor we cannot test the mail request from a remote server to the smtp server. So the only way is the remote script execution. But unfortunately am not expert in perl script. So could you please provide me the script, which will send dummy mails and recieve the response from smtp server. So from the response I can determine whether the mailing is successfull or not. 

 

Regards

Pradeep

Advisor
RahulGupta
Posts: 27
Registered: ‎03-07-2012
Message 4 of 7 (248 Views)

Re: Running a script in remote computer

[ Edited ]

f i understand your problem. MAPI will help you. 

 

You can login into ur account, send/delete/read mails.

 

 

vuser_init()
{
lr_start_transaction("Logon");

mapi_logon("Logon",

"hpbaer06",

"3R06",

LAST);

 

lr_end_transaction("Logon", LR_AUTO);

return 0;
}

 

   

Action()
{

char rc;
int i;

 

// Set to beginning, read & delete

lr_start_transaction("Delete_Mail");


do {

mapi_set_property_sz("Message ID","");

// Read mail
rc = mapi_read_next_mail("",
"Show=all", //
"Peek=True", // [Optional: default = False]
"Type=IPM",
LAST);
// Delete read mail
if (rc == LR_PASS) {
char *msg_id = mapi_get_property_sz("Message ID");
if ((msg_id) && (*msg_id))
{
char msg_arg[640];
sprintf(msg_arg,"id=%s",msg_id);
lr_output_message("Delete mail w/ %s ...",msg_arg);
mapi_delete_mail("",msg_arg,LAST);
}
}
} while (rc == LR_PASS);


lr_end_transaction("Delete_Mail", LR_AUTO);

 

 

 

Occasional Advisor
pradpaul2000
Posts: 12
Registered: ‎04-27-2011
Message 5 of 7 (243 Views)

Re: Running a script in remote computer

HI,

 

I think the provided script will delete the read mail from the account only. I need a script which will send one mail and should get back a response from the smtp server. So from that response we can determine the status.

Honored Contributor
Sujith Kumar C.S
Posts: 871
Registered: ‎04-07-2010
Message 6 of 7 (233 Views)

Re: Running a script in remote computer

Then you better use the utility blat and call this. Call the utility and write to log and and look for specific text which will tell you that message has been successfully received or not.

 

http://www.blat.net/

https://www.techsupportalert.com/content/send-email-windows-command-line.htm

 

--Sujith

 

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Advisor
RahulGupta
Posts: 27
Registered: ‎03-07-2012
Message 7 of 7 (226 Views)

Re: Running a script in remote computer

lr_start_transaction("Send_Mail");

mapi_send_mail("SendMail",

"To=h1@aaaao.nl",

"Subject=Email Testing from Script!",

"Body=Test Message! Please ignore.",

LAST);

lr_end_transaction("Send_Mail", LR_AUTO);

 

lr_start_transaction("Receive_Mail");

 

 

lr_start_transaction("Receive_Mail");

// Reset current message to beginning of mail box

i = 0;
mapi_set_property_sz("Message ID", "");


// Loop to read Inbox every 1s until mail arrives or during max 10mins

do {

lr_think_time(1); // Peek at next mail (don't mark it as read)

rc = mapi_read_next_mail("", "Show=all", "Peek=False", LAST);

i++;


} while ((rc == LR_FAIL) && (i < 600));


// Define transaction success if there is a mail received in mailbox


if (rc == LR_PASS) lr_end_transaction("Receive_Mail", LR_PASS);

else lr_end_transaction("Receive_Mail", LR_FAIL);

 

you might need to login before sending mail...........

 

Hope it ll help

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.