Send email using Telnet

August 25, 2013
How to send email through Telnet.

You can use it for troubleshoot purpose when sometime outgoing issue from the mail server.

1. First open the Command prompt. ctrl+r, now type "cmd".

before that you have to enable telnet service from control panel>program and feautre>Turn windows features on or off> now choose telnet client

2. Now, connect with telnet command just type

telnet mail.yourdomain.com 25



3. From the picture, you already enter into the server now use following command

helo mail.yourdomain.com




4. type mail from username, see on screenshots

mail from: username@yourdomain.com



5. Type receiver ID here, see screenshot.

rcpt to: yourfriend@hotmail.com, yourfriend@yahoo.com



6. To add message just use "data" command and type "subject" command. At the end don't forget to add "." to end the message and press enter.


data
subject: this is test email

hello,

This is jpudasaini.com.np, the portal where you can hangout for tutorial on the job training.

Regards
jpudasaini.com.np

.

7 Type quit to exit.

Identified SMTP mail server

July 22, 2013
This tutorial helps you to determine the mail server for any email address. This is helpful to identified SMTP mail sever to use or configure Outlook.

In day to day work I need to troubleshoot email ID with mail hosting server, so this syntax is very useful for me, if you don't kown the mail server just use following syntax to identify the mail server
mail.domainname.com or smtp.domainname.com, it those doesn't work then you need to follow below steps.

(change "domainname" with your desire domain.)

1. Open a DOS Command Prompt
2. Type "nslookup"
3. Your computer's DNS server name and IP address will be displayed.
4. Now just type "set type=mx" - this will force NSLOOKUP to shows Mail eXchange records from the DNS servers.
5. You can try using gmail.com or use your own domain name.
6. you can see below output.

Restart Network in Ubuntu Linux

July 08, 2013
In Ubuntu there was inbuilt command whose job is to network card reconfiguration. Lets see the syntax

jay@server:~$ sudo /etc/init.d/networking restart
****OutPut****
[sudo] password for jay:
 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces                                                              
 * Reconfiguring network interfaces...                                                                                                                   ssh stop/waiting
ssh start/running, process 1818
                                                                         [ OK ]

This Ubuntu script will start and stop all network interface (NIC) at once.

Alternative

jay@server:~$ sudo ifconfig eth0 down
 (replace eth0 with your ethernet number)
wait for ethernet down.

jay@server:~$ sudo ifconfig eth0 up
[sudo] password for jay:

Find and replace text in Linux Command

July 08, 2013
Most of you encounter a situation where you need to replace the text in Linux file. Recently  I need to do this in Ubuntu server for changing repo "US"  to "local" repo. Therefore here is the process how to change it.

You can use vi and vim text editor comes with every Linux OS, if your Linux don't have full function text editor then use this link to install it.

In my case I use it for replace international repo to local repo, you can use for any text replacement.

So I use word "US" to replace with "NP", Which is local for me.
Now use the following command to edit repo source

#sudo vi /etc/apt/sources.list


You can see  repo source list file is opened, then just use the following syntax to replace the text: In my case I use "us" and "np" word, please replace these with your desire word.

:%s/us/np/g

or if you need to conformation then you us this command, mean if you don't need to replace whole text.

:%s/us/np/gc

following command can be used for current line only
:s/us/np/g