As per Maxim's answer, but the link died. Add this to the config file:
<system.net>
<mailSettings>
<smtp>
<network
clientDomain="mail.domain.com"
/>
</smtp>
</mailSettings>
</system.net>