• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 827
  • Last Modified:

CSmtpConnection problems

I am trying to send mail to different domains like yahoo , gmail , and other.
I am using CSMTPConnection release and it doesnt wanna send.It only sends mail to the ones that have the same domain like mine on the MS Outlook.
How do i fix this problem? Which smtp server do I need to use?
Thanx  in advance
0
sjcu
Asked:
sjcu
  • 6
  • 5
  • 5
2 Solutions
 
mahesh1402Commented:
Dont know what exact your problem is but...Have you referred this sample on MSDN :
http://msdn2.microsoft.com/en-us/library/6c3k2z70(VS.80).aspx


MAHESH
0
 
mahesh1402Commented:
You may also refer sample class on codeproject derived from CSmtpConnection :
http://www.codeproject.com/internet/csmtpconn.asp

MAHESH
0
 
sjcuAuthor Commented:
Mahesh
One of the issues from the sample in code project is exactly the same as the one i have... so there seems to be a problem.
I am thinking it could be a mail server setting or security issue...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mahesh1402Commented:
have a look at www.naughter.com ...

There are a lot of sources, and in the network section, you will found CSmtpConnection and CPopConnection.

http://www.naughter.com/freenetwork.html <======

MAHESH
0
 
roshkmCommented:
Probably, the port for other mail server is blocked in the firewall.

Try to do a telnet to the port 110. for eg: telnet mail.xxxxx.com 110 in command prompt.

If it is not working, then u can assume that the port is blocked and only your mail server is allowed. Admins do that in order to avoid spam mail generation.

Regards,
RKM.
0
 
sjcuAuthor Commented:
RKM,
Ok. I tried the telnet and this is the response i got. I understand the spam part, but this is outgoing mail... So i am not sure why this
should be blocked. However from my outlook i can send mail to other domains.. But from my program its not working.

+OK Microsoft Exchange Server 2003 POP3 server version 6.5.7226.0 (splkexch.span
link.com) ready.

Mahesh, I will look at Naughters site...
0
 
roshkmCommented:
Most admins block the ports so that if ur machine is acting as a spam generator and pumping out mails to others, the same can be avoided. The admin can avoid certain apps like Outlook from being blocked.

I was sorry abt the port number.. it is 25. So try telnet that..for eg: telnet mail.xxxxx.com 25 in command prompt.

If it is working, then check whether the port 25 is bind by  some other application or in the same app somewhere before initialising SOCKADDR_IN.

It might be better to write a wrapper class for this purpose and it is already available at http://www.codeproject.com/internet/csmtpconn.asp which was pointed by mahesh.

Hope it will work fine.

Regards,
RKM
0
 
sjcuAuthor Commented:
Ok.  I tried with port 25.

220  Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready
 at  Fri, 28 Apr 2006 09:32:05 -0500

I am using the CSMTPConnection class provided by Microsoft (ATL) so i do
CSMTPConnection conn;
0
 
sjcuAuthor Commented:
Sorry...

conn.Connect(m_sMailServerAddr.t_str());
bSuccess = conn.SendMessage(mMsg, NULL, NULL);            

So am i missing something... No i am not using port 25 for anything .. I am not initializing any socket addr, i dont have to every thing
is handled by the CSMTPConnection class.

Do i have to use the code project one...  ?

Thanks
0
 
roshkmCommented:
I suggest , you should try the code project one too.. if that is also not working then there is something really serious that we have to look into.

Before implementing the one from Code Project, try whether the sample tool supplied along in Code project is working or not.. If working, proceed..

Regards,
RKM
0
 
mahesh1402Commented:
sjcu ,
 you may try codeproject and code from naughter.com site too.

MAHESH
0
 
sjcuAuthor Commented:
I tried the sample from the code project, (http://www.codeproject.com/internet/csmtpconn.) and i cannot send the email. However i received an error code .. The class that i use does not give valid error codes so its all the difficult troubleshoot...

550 unable to relay for the outside domain addr. Any ideas as to how to allow acess.

Thanks
0
 
roshkmCommented:
Which anti virus are u using? Is it McAfee? Some anti Virus has the blocking of certain port and exes by default. you can refer with ur SysAdmin regarding this to get the port open if thats the case

Regards,
RKM
0
 
roshkmCommented:
And also one more thing. Check the configuration of the mail server you are trying to connect to. May be it wont supprt relaying.. ie. mailing to another domain.. To check this, try mailing to an id in the same domain. If it is successful, then we can confirm that the relaying is blocked in the SMTP mail server you are connecting to.

To rectify this, may be u can install a local SMTP mail server on ur machine and try sending mails. one such SMTP Server is downloadable at http://www.softstack.com/advsmtp.html.

Cheers,
RKM
0
 
mahesh1402Commented:
split me and roshkm.

-MAHESH
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now