Send email from gitlab ci job that uses docker runner

Hello… I am in need of sending a mail from gitlab ci job. I tried it with shell runner it worked but it dint work with docker runner

I tried using mailgun and mailx also… Job is succeeding but the mail is not sent. hlp me with it.