The email goes suceessfully when I send it from localhost and use an external smtp settings, but email never goes when I run the code on live server and email has attachment. In web.config I have:

```
 <system.net>
    <mailSettings>
        <smtp>
            <network host="localhost" />
        </smtp>
    </mailSettings>
</system.net>

```

This problem only arises on live site with email attachment. It works fine on localhost with or without attachment.