Logic says: User 1 sends a message to User 2 via Server 1. Server 1 records it in DB (mysql) and sends the message to Server 2 to be sent to User 2. Server 1 responds to User 1 that message has been sent. While at the back-end (asynchonously) Server 1 keeps requesting Server 2 for the delivery of the message, when delivered, updates the database and set delivery status as delivered or failed (after few hours of re-trying).
But I don't think this code is working. Because database never gets updated.
SendMessage.aspx
global.cs