Mail doesn't get messages from a web page. It, like the web page, get them from an e-mail server.
Depends on the protocol (IMAP or POP), but look in the Mailbox Behaviors tab in the Accounts pane of Mail's preferences. There's an option for IMAP to store deleted messages on the server. For POP there are options in Mailbox Behaviors and the Advanced tab that can control when messages are removed from the server.