Fig wrote:Could someone confirm me the IP instead of the "smtp" is a proper way to go ?
I tested this to make sure. SendMail() is quite happy to accept a server IP's address rather than a qualified domain name - if that's what you mean? (There's not directly such a thing as an "SMTP address" the way you allude in your first post - SMTP is not an addressing protocol, it's a data transfer protocol).
Fig wrote:If so, the mail server probably need to accept request from my program like a mailclient. I may need to parameter specificaly the mail server... ? (specify like outlook.exe....)
Yes to the first bit, but that shouldn't be an issue - it's what mail servers are meant to do. How is outlook.exe specifiying the mail
server? Outlook is a
client program. I don't follow your thinking there!
Fig wrote:Doesn't it need to know the name of program allowed to access it as client ?
Not specifically as far as the SMTP protocol is concerned, however other things may be interfering - see below... As long as the submission is on the right port and conforms to the SMTP message protocol properly it should be accepted by the server. (Note however that this is
not the same as
delivering a message.)
There are a few things:-
1) Your code fragment is not nearly complete enough. The problem could be caused elsewhere in your code - by a missing recipient address for example.
2) Check the value of MailProgress() after the send. I'm guessing the result is #PB_Mail_Error but an actual confirmation of this would eliminate some guessing.
3) Is your
login really of the form "
email@my-firm.com"? Just because your
email address looks like that doesn't necessarily mean your server login does, it might depend on which mailserver your firm is using...
4) Check the logs on the mail server. Did the connection get established? If so, was the message accepted? Either way, it might report what the problem with the message was. If there is no trace of the message but other messages are logged from your usual email client on the machine normally then this may suggest a connection problem rather than an SMTP problem.
5) Does your firm use desktop firewall, anti-virus or other security software? If so, does it whitelist software? It's possible to configure firewalls, for example, to disallow access to the SMTP ports for applications that aren't standard. For example outlook.exe could be whitelisted and others would be blacklisted - this would then automatically exclude your program. Check the security software logs on the sending machine.
6) Does your firm have security or spam scanning software on its email server? This might be declining to accept your message on the grounds it looks like spam. Check the logs on the security software.