Link to home
Start Free TrialLog in
Avatar of Robert Hester
Robert Hester

asked on

Emails on Queue - IIS6 on 2003 Server using cdosys

Hi,
Emails sent by code below get stuck on queue folder, please help to have them sent.


- Port 25 is open
- SMTP services are running
- SMTP server is mail.yourcompany.com
- I  have to send from specific email address robert@yourcompany.com with password
- My current code:

<%

Set objCDOSYSMail = Server.CreateObject("CDO.Message")

Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.yourcompany.com"
 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") =1

objCDOSYSCon.Field("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "robert@yourcompany.com"

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"


objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30

objCDOSYSCon.Fields.update
Set objCDOSYSMail.Configuration = objCDOSYSCon

objCDOSYSMail.From = " robert@yourcompany.com"

'NOME DO DESINAT?RIO, E-MAIL DO DESINAT?RIO
objCDOSYSMail.To = "robert@yahoo.com"

objCDOSYSMail.Subject = "Test sending email"

objCDOSYSMail.TextBody = "Trying to send emails"

objCDOSYSMail.Send

Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

response.write "Email sent with success"

%>


I imagine the problem is related to relay/permissions or even some kind of restriction on robert@yourcompany.com since the IT guys may have chasnged a configuration or two to make things difficult for me.
I say this because sending email has worked basicaly with the same code and configuration I have. These might be different now due to my trials to get it back working,

Thanks in advance. Any help will be appreciated..
Avatar of Dimitris Ioakimoglou
Dimitris Ioakimoglou
Flag of Greece image

Speaking as an admin and not a programmer, you should check with your IT if they changed any autentication methods allowed on their mail server.
Avatar of Robert Hester
Robert Hester

ASKER

Could you please be more specific in what i should ask?
Could we verify before if my configurations on relays and permissions are ok?
Thanks
Avatar of Sanjay Santoki
Hello,

If the email is stucked in mail queue, it should not be the authentication problem. If it is authentication problem, mail server couldn't accept the email.

It could be DNS related issue. Make sure the required outgoing ports are allowed from your mail server to the internet.

Please try to restart the SMTP service once.

Are you using any smarthost to relay emails on behalf if your mail server?

Regards,
Sanjay Santoki
I have already restarted SMTP services and also IIS itself. I Even
restarted the server ;-)

I have used telnet servername 25 and the smtp port is open (is that all I should check with telnet?)

The domais is servername.companyname.net and CHECK DNS test is ok

I am not using any smarthost´- field is empty

I am fully open for suggestions on how to test and narrow the scope of where issue could be..
Is the code ok?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Enable logging on your SMTP server and check the log files.
You should see the reason why the mails cannot be delivered listed in there.
It was not actually the solution, but it lead me to consider using the pickup directory.
Therefore I started all sorts of combination of parameters with the code until it finally worked
THanks for the points but that's not how the grading works:

Grading Guidelines
An A grade should be given if you receive the solution from the Experts; you should consider the A grade the default unless it is deficient.
A B grade should be given if the solutions require you to do a good amount of extra work to resolve your problem.
A C grade is the lowest possible grade you can give. Experts should always be given the opportunity to improve it -- but that does not mean they should rewrite your entire application for you.

It is customary to explain any grade that is not an A.
I´m sorry...
I did inform Multiple solutions and my intention was to really split the award. After submiting I saw 500 points had been awarded I I did not find how to edit.

I agree in changing...but how?
The moderator has undone your solution so go ahead and distribute the points as you see fit.
Use the Accept Multiple Solutions to distribute the points.  See here for how to do it: https://www.experts-exchange.com/help/viewHelpPage.jsp?helpPageID=24
See thread of posts