?
Solved

Auto Send Email with MailEnable in ASP problem

Posted on 2005-02-25
3
Medium Priority
?
851 Views
Last Modified: 2012-06-27
I'm using MailEnable as my email server. It is the relay setting causing the error.

Currently, I only allow authenticated sender to send emails..

And I can send email to myself (admin@mydomain.com).
It wouldn't allow to send email to external email service such as yahoo or hotmail

Then I edit the relay setting to "allow local address senders" to send emails. Everything works fine.

If allow this option, then I will have a security issue. I have learned my lesson well, people used my email server to send spam emails.

what are the ways to go around it? Thanks.


Here is the ASP code that autosends email..
<%
sch = "http://schemas.microsoft.com/cdo/configuration/
Set cdoConfig = Server.CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(sch & "sendusing") = 2
cdoConfig.Fields.Item(sch & "smtpserver") = "<mail.mydomain.com>"
cdoConfig.fields.update

Set cdoMessage = Server.CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "admin@mydomain.com"
cdoMessage.To = "tester@hotmail.com"
cdoMessage.Subject = "Sample CDONTS NewMail"
cdoMessage.TextBody = "This is a test for CDONTS message"
cdoMessage.Send
Set cdoMessage = Nothing
Set cdoConfig = Nothing
response.write "Email sent"
%>
0
Comment
Question by:Discusman
3 Comments
 

Author Comment

by:Discusman
ID: 13410074
Moderator,

Plz delete this message since this is a bug issue with MailEnable. Hence, no solution for this problem.

Thanks.
0
 
LVL 13

Expert Comment

by:nurbek
ID: 13410801
no points :)

but you can try like this
once you entered username and password, you will be able to send to hotmail,yahoo etc ...


     Dim objCDOConf,objCDOSYS
     Set objCDOSYS = Server.CreateObject("CDO.Message")
     Set objCDOConf = Server.CreateObject ("CDO.Configuration")
     With objCDOConf
          .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mydomain.com"
          .Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername"
          .Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypass"
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Fields.Update
     End With
     Set objCDOSYS.Configuration = objCDOConf

     With objCDOSYS    
          .From = "from@myemail.com"
          .To = "me@mymail.com"
          .Subject = "Subject comes here"
          '.HTMLBody = strMailBody
          .TextBody = "Test message"
          .Send
     End with                    
     Set objCDOSYS = Nothing
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 13411869
Question answered by asker or dialog deemed valuable.
Closed, 125 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Integration Management Part 2
Loops Section Overview
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question