Hi Guys,
Have been surfing the net looking for code that would allow me to send e-mails. Found the following code in the live demo at: http://www.4guysfromrolla.com/webtech/112298-1.shtml
Now, am i right in saying that i simple just have to create an accout from which i can send the emails. But where in the code do i specify the password to the address (Know its a stupid question).
<%
If Len(Request.Form("txtEmail")) > 0 then
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "info@4guysfromrolla.com (4GuysFromRolla.com)"
objMail.Subject = "Email attachment demo"
objMail.AttachFile Server.MapPath("/images/new468x60.gif")
objMail.To = Request.Form("txtEmail")
objMail.Body = "This is a demo on sending an email with an attachment."
objMail.Send
Response.write("<i>Mail was Sent</i><p>")
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post" id=form1 name=form1>
<b>Enter your email address:</b><br>
<input type="text" name="txtEmail" value="<%=Request.Form("txtEmail")%>">
<p>
<input type="submit" value="Send me an Email with an Attachment!" id=submit1 name=submit1>
</form>
Have been surfing the net looking for code that would allow me to send e-mails. Found the following code in the live demo at: http://www.4guysfromrolla.com/webtech/112298-1.shtml
Now, am i right in saying that i simple just have to create an accout from which i can send the emails. But where in the code do i specify the password to the address (Know its a stupid question).
<%
If Len(Request.Form("txtEmail")) > 0 then
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "info@4guysfromrolla.com (4GuysFromRolla.com)"
objMail.Subject = "Email attachment demo"
objMail.AttachFile Server.MapPath("/images/new468x60.gif")
objMail.To = Request.Form("txtEmail")
objMail.Body = "This is a demo on sending an email with an attachment."
objMail.Send
Response.write("<i>Mail was Sent</i><p>")
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post" id=form1 name=form1>
<b>Enter your email address:</b><br>
<input type="text" name="txtEmail" value="<%=Request.Form("txtEmail")%>">
<p>
<input type="submit" value="Send me an Email with an Attachment!" id=submit1 name=submit1>
</form>