Whing Dela Cruz
asked on
send email part1
Hi experts, how to start coding to develop email to send someone else? I have codes below but I do not know how to do next. Thank you!
<!DOCTYPE html>
<html>
<body>
<h2>Send e-mail</h2>
<form>
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
From:<br>
<input type="text" name="Sender" value="hobbit@yahoo.com">< br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>Send e-mail</h2>
<form>
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
From:<br>
<input type="text" name="Sender" value="hobbit@yahoo.com"><
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
ASKER
Hi experts, I tried to use this code as shown below base on Chong suggested above formula, but found no result at all. I've got not error but when I check the recipient mail, I found nothing. I run this code to server side asp and when I execute it a Response.Write is responding. Am I doing in a right way or this is totally wrong? any guide please. Thank you!
<%
Set myMail = CreateObject("CDO.Message" )
myMail.Subject = "Sending email with CDO"
myMail.From = "hobbitdelacruz@yahoo.com"
myMail.To = "niwre@yahoo.com"
myMail.TextBody = "This is a message."
myMail.Send
set myMail = nothing
Response.Write "Successfully sent!"
%>
<%
Set myMail = CreateObject("CDO.Message"
myMail.Subject = "Sending email with CDO"
myMail.From = "hobbitdelacruz@yahoo.com"
myMail.To = "niwre@yahoo.com"
myMail.TextBody = "This is a message."
myMail.Send
set myMail = nothing
Response.Write "Successfully sent!"
%>
you may need to configure the SMTP details before you sending the email out.
you can refer to the answer of this question:
https://www.experts-exchange.com/questions/24535297/CDOSYS-Sending-to-Yahoo-Moved-to-Spam-Folder.html
with following yahoo mail settings:
Yahoo SMTP configuration
http://www.serversmtp.com/en/smtp-yahoo
you can refer to the answer of this question:
https://www.experts-exchange.com/questions/24535297/CDOSYS-Sending-to-Yahoo-Moved-to-Spam-Folder.html
with following yahoo mail settings:
Yahoo SMTP configuration
http://www.serversmtp.com/en/smtp-yahoo
ASKER
Hi experts, I can able to run the code as shown below after fixing smtp. However, my recipient still can't receive the email after sending it base on the code below. The code has no error. What should I do next?
<%
Set myMail = CreateObject("CDO.Message" )
myMail.Subject = "Sending email with CDO"
myMail.From = "hobbitdelacruz@yahoo.com"
myMail.To = "niwre@yahoo.com"
myMail.TextBody = "This is a message."
myMail.Configuration.Field s.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
myMail.Configuration.Field s.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "118.91.12.75"
'Server port
myMail.Configuration.Field s.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Field s.Update
myMail.Send
set myMail = nothing
Response.Write "Successfully sent!"
%>
<%
Set myMail = CreateObject("CDO.Message"
myMail.Subject = "Sending email with CDO"
myMail.From = "hobbitdelacruz@yahoo.com"
myMail.To = "niwre@yahoo.com"
myMail.TextBody = "This is a message."
myMail.Configuration.Field
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
myMail.Configuration.Field
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "118.91.12.75"
'Server port
myMail.Configuration.Field
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Field
myMail.Send
set myMail = nothing
Response.Write "Successfully sent!"
%>
ASKER
Hello Experts, When I run the code shown above no error appeared, but SMPT error goes directly to Badmail. The specific error code was 0xC00402C7. Is there anyone who can help me which part of my server needs to fix? I am using iis v5.1 and my Default SMPT has already set-up. Thank you!
so you wish to send out emails via default SMTP setting in IIS OR via a SMTP setting just like your email (your own domain email, yahoo, etc) ?
ASKER
HI Chong, I actually can't differentiate among the two options, but I guest via dafault SMTP setting in IIS is good for me since I have already setting up them on my server pc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much Chong, It's working. Now, I'm so happy that I can send email. Thanks for providing me such codes. More power and God bless!
For more info:
ASP Sending e-mail with CDOSYS
https://www.w3schools.com/asp/asp_send_email.asp