How can I <iframe> Gmail?

2019-01-12 02:25发布

I know that Gmail might put some security measures in place to prevent this, but I really need to put Gmail inside an element.

The two following methods don't work:

<object type='text/html' data='http://mail.google.com/'></object>

<iframe src='http://mail.google.com/' frameborder=0 style='width:322px; height:480px;'></iframe>

Are there any other ways?

2条回答
Melony?
2楼-- · 2019-01-12 02:59

You cannot. GMail, like most of Google's other web services, sets the HTTP header:

X-Frame-Options: SAMEORIGIN

which disallows their site from being framed by any site other than GMail itself.

查看更多
别忘想泡老子
3楼-- · 2019-01-12 03:06

You would be better off using Google API. http://code.google.com/appengine/docs/python/mail/

Although not a solution to your question I believe this is an appropriate alternative.

查看更多
登录 后发表回答