Page 18 of 25

Posted: Fri Mar 27, 2009 10:49 am
by maw
Probably because you have a corporate firewall blocking external SMPT-access at work.

Posted: Fri Mar 27, 2009 11:43 am
by doctorized
I have AVG 8.5 Internet security installed and when it asks if I want to let the program connect I say yes but the connection fails. I have the same program instaleed at home and there is no problem.
(Both computers connect directly to the web.)

Posted: Fri Mar 27, 2009 11:51 am
by doctorized
maw wrote:Probably because you have a corporate firewall blocking external SMPT-access at work.
Even if I shut the firewall down the problem still exists.

Posted: Fri Mar 27, 2009 12:38 pm
by PB
Post the code you're using (and remove the login/password first).

Posted: Fri Mar 27, 2009 5:41 pm
by doctorized
PB wrote:Post the code you're using (and remove the login/password first).

Code: Select all

If OpenWindow(0, 300, 300, 260, 210,"Email Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)

If CreateGadgetList(WindowID(0))
StringGadget(0,50,10,200,20,"");server
StringGadget(1,50,32,200,20,"");sender
StringGadget(2,50,54,200,20,"");taker
StringGadget(3,50,76,200,20,"");login name
StringGadget(4,50,98,200,20,"");login password
StringGadget(5,50,120,200,20,"");mail body
TextGadget(6,10,12,40,20,"smtp :")
TextGadget(7,10,34,40,20,"sender :")
TextGadget(8,10,56,40,20,"taker :")
TextGadget(9,10,78,40,20,"ID :")
TextGadget(10,10,100,40,20,"pass :")
TextGadget(11,10,122,40,20,"body :")
TextGadget(12,10,144,40,20,"interval :")
StringGadget(13,50,142,40,20,"30")
ButtonGadget(14,90,170,80,30,"OK with pass")
EndIf

Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_CloseWindow  
Quit = 1
ElseIf EventID = #PB_Event_Gadget
Select EventGadget()
Case 14
MySMTPServer.s = GetGadgetText(0)
MySMTPPort.l = 25 
TimeOut.l = Val(GetGadgetText(13))
PureSMTP_SetTimeOut(TimeOut)
If PureSMTP_OpenSMTPConnection(MySMTPServer, MySMTPPort) = #PureSMTP_Ok 
MailTo.s = GetGadgetText(2)
MailFrom.s = GetGadgetText(1) 
Subject.s ="Hi!"
MsgBody.s = GetGadgetText(5) 
Attachments.s
UserName.s = GetGadgetText(3)
Password.s = GetGadgetText(4)
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password) 
If Status = #PureSMTP_Ok
MessageRequester("sent:" + Str(Status),PureSMTP_GetLastServerMessage())
Else 
MessageRequester("failed:" + Str(Status),PureSMTP_GetLastServerMessage())
EndIf 
PureSMTP_CloseSMTPConnection() 
Else 
MessageRequester("OpenSMTPConnection failed",PureSMTP_GetLastServerMessage())
EndIf
EndSelect
EndIf

Until Quit = 1

EndIf

End

Re: Spam mail

Posted: Mon Mar 30, 2009 12:52 pm
by gnozal
doctorized wrote:I use the example code included in the zip file of PureSMTP lib and all the massages sent goes to the spam folder and not the inbox. Why?
Maybe you could change the X-mailer ?

Posted: Mon Mar 30, 2009 12:54 pm
by gnozal
The error code returned by PureSMTP_SendMail() as well as the PureSMTP_GetLastServerMessage() could help.

Re: Spam mail

Posted: Tue Mar 31, 2009 11:00 am
by doctorized
gnozal wrote:
doctorized wrote:I use the example code included in the zip file of PureSMTP lib and all the massages sent goes to the spam folder and not the inbox. Why?
Maybe you could change the X-mailer ?

Change it to what? I do not know what to give.

Posted: Tue Mar 31, 2009 11:09 am
by doctorized
gnozal wrote:The error code returned by PureSMTP_SendMail() as well as the PureSMTP_GetLastServerMessage() could help.

PureSMTP_GetLastServerMessage() returns nothing.

Re: Spam mail

Posted: Tue Mar 31, 2009 11:11 am
by gnozal
doctorized wrote:
gnozal wrote:
doctorized wrote:I use the example code included in the zip file of PureSMTP lib and all the massages sent goes to the spam folder and not the inbox. Why?
Maybe you could change the X-mailer ?
Change it to what? I do not know what to give.
To 'Lotus Notes Release 6.5.5 November 30, 2005' or 'Microsoft Office Outlook, Build 11.0.5510' for example, any well known mail client.

Posted: Tue Mar 31, 2009 11:14 am
by gnozal
doctorized wrote:
gnozal wrote:The error code returned by PureSMTP_SendMail() as well as the PureSMTP_GetLastServerMessage() could help.
PureSMTP_GetLastServerMessage() returns nothing.
And PureSMTP_SendMail() ?
PureSMTP.chm wrote:Error codes :
#PureSMTP_FileError = -1
#PureSMTP_NoConnection = -2
#PureSMTP_BadResponse = - 3
#PureSMTP_MemoryAllocationProblem = -4
#PureSMTP_AuthentificationFailed = -5
#PureSMTP_ServerTimeOut = -6
#PureSMTP_Abort = -7

Posted: Thu Apr 02, 2009 9:45 am
by doctorized
gnozal wrote:
doctorized wrote:
gnozal wrote:The error code returned by PureSMTP_SendMail() as well as the PureSMTP_GetLastServerMessage() could help.
PureSMTP_GetLastServerMessage() returns nothing.
And PureSMTP_SendMail() ?
PureSMTP.chm wrote:Error codes :
#PureSMTP_FileError = -1
#PureSMTP_NoConnection = -2
#PureSMTP_BadResponse = - 3
#PureSMTP_MemoryAllocationProblem = -4
#PureSMTP_AuthentificationFailed = -5
#PureSMTP_ServerTimeOut = -6
#PureSMTP_Abort = -7
PureSMTP_SendMail() returns -2.

Posted: Thu Apr 02, 2009 11:11 am
by gnozal
doctorized wrote:PureSMTP_SendMail() returns -2.
That means there is no current connection, i.e. PureSMTP_OpenSMTPConnection() failed or you called PureSMTP_CloseSMTPConnection(). This is strange, because in the code you posted, PureSMTP_SendMail() isn't called if PureSMTP_OpenSMTPConnection() failed.

Posted: Fri Apr 03, 2009 8:14 am
by doctorized
gnozal wrote:That means there is no current connection, i.e. PureSMTP_OpenSMTPConnection() failed or you called PureSMTP_CloseSMTPConnection(). This is strange, because in the code you posted, PureSMTP_SendMail() isn't called if PureSMTP_OpenSMTPConnection() failed.
PureSMTP_SendMail() returns -2 if I cut the "If" from the PureSMTP_OpenSMTPConnection() so PureSMTP_SendMail() is called.

Posted: Fri Apr 03, 2009 11:40 am
by gnozal
I guess PureSMTP_OpenSMTPConnection() fails because you have a corporate firewall / proxy at work, and unfortunately Purebasic network functions don't support proxies.
I have the same issue at work.