When trying to send an email using webmail the email send is very slow and potentially errors after time.
This typically occurs due to DNS lookups called DNS recursion. On a Linux server, the recursion servers are typically stored in /etc/resolv.conf
The best approach is to contact your server/service provider and ask what recursion servers are available in the data center used to host the server. If this is not possible or may take too long then you can use publicly available recursion servers.
The two most common ones are the Google recursion servers
and Cisco OpenDNS servers
To add any of these you would modify /etc/resolv.conf and before any nameserver, line add for example
and then save the file.
Then test sending email again.