Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

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>
HTMLASPJavaScript

Avatar of undefined
Last Comment
Whing Dela Cruz
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

you can try use CDOSYS to do that. it should allow you to configure the SMTP details when necessary.

For more info:

ASP Sending e-mail with CDOSYS
https://www.w3schools.com/asp/asp_send_email.asp
Avatar of Whing Dela Cruz

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!"
%>
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

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
Avatar of Whing Dela Cruz

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.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "118.91.12.75"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Update
myMail.Send
set myMail = nothing
Response.Write "Successfully sent!"
%>
Avatar of Whing Dela Cruz

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!
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

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) ?
Avatar of Whing Dela Cruz

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
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Whing Dela Cruz

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!
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo