I wonder if I can send an email via smtp using Gmail account without installing a mail server or not?
For example:
re_pass.asp

<p>Password Reminder</p>
<form method="post" action="re_pass_process.asp">
	<input type="text" name="email">
	<input type="submit" value="Send">
</form>

re_pass_process.asp

<!--#include file="connection.asp"-->
<%
openConn()
email = request("email")
response.Write(email)
''response.End()
if trim(email) <> "" then

	sql= "select password from candidate where email = '" & replace(email,"'","''") & "'"
	''response.Write(sql)
	''response.End()
	set rs = createobject("adodb.recordset")
	rs.open sql,conn
	''response.End()
	if not rs.eof then
		set msg = createobject("CDO.Message")		
		msg.to = email
		''response.Write(email)
		msg.from = "tranlinh.nmt@gmail.com"		
		msg.subject = "123456" ' pass for mail:tranlinh.nmt@gmail.com
		
		msg.TextBody = "Hello. Your password is " & rs("password")
		response.Write rs("password")
		''response.End()
		msg.Send
		response.End()
	end if
	rs.close
end if
%>

As above, what need to be installed to send an email?

Recommended Answers

All 2 Replies

If you are sending this from a Windows server then you will have either CDONTS or CDOSYS support anyway. In which case you can use "localhost" as your mail server or nominate one which will allow you to relay.

Is that what you are trying to do, by using gMail as the mail server or are you just trying to send email to your own account at gMail?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.