Found out how to do this by reading this blog here
Follow the steps below, if you want to change the source SMTP ip address in sendmail.
1) change the line below in sendmail.cf
#O ClientPortOptions=Family=inet, Address=x.x.x.x
to
O ClientPortOptions=Family=inet, Address=**ip address you want**
) restart sendmail
Send a test mail and check its header. The source IP address should have changed 🙂