Is melatonin or magnesium safe to take nightly

From

Full email screenshot: Is melatonin or magnesium safe to take nightly from Sleep Doctor