Then issue
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Restarted sendmail
Unfortunately the above modification did not work. At the moment when I send an email it changes the �To address field� to �username@hostname.domain.com� but I would like to be �username@domain.com�
You want "canonical name", not "masquerading". My Sendmail skills are too rusty to help you with the details but quick googling suggests $j might have something to do with that.