Page 25 of 25
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Fri Oct 11, 2013 7:43 am
by supercdfr
I can't use any of the gnozal because of the MISC missing.
1 of the most useful lib put away by purebasic, that's the first time i see that.
Gnozal, if you read this, please help us

Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Thu Oct 17, 2013 10:11 am
by Falko
+1
[Edit]
No answer is also any answer
But I'm hoping that will come a new version for PB 5.20+
[/Edit]
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Tue Jan 21, 2014 10:58 pm
by Rbender
It does not seem to be true
Anyone know why?
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Tue Jan 21, 2014 11:09 pm
by IdeasVacuum
PureSMTP is excellent, I have used it a lot. However, ts-soft has published an equally good solution which has been enhanced by a number of people:
http://www.purebasic.fr/english/viewtop ... 12&t=50538
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Wed Jan 22, 2014 12:29 am
by Rbender
Thx for the tipp. First tests look great.

Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Mon Apr 14, 2014 4:01 pm
by ruslanx
Hi, can someone help me to fix the code ..
... how can I send mail in HTML with Attachment .. better look at screenshots to understand my problem.

.. with attachment .. I have problems ??!!!
The Code:
Code: Select all
; Header -----------------------------------------------------
MsgBody.s = ""
MsgBody + "<div style='background-color:#F0F8FF;font-family:verdana;padding:6px;border-radius:3px;border:2px solid #72B68F;'>"
MsgBody + "<h3 style='text-align:center;color:Green;'><ins> TEST </ins></h3>"
; """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Window Header -----------------------------------------------
MsgBody + "<div style='opacity:0.9;background-color: #72B68F; border-radius:3px;border:1px solid #505050; padding: 5px;'>"
MsgBody + "<font size='2' color='#000000'><i><b> NAME1: </b></i></font>"
MsgBody + "<font size='2' color='#FFFFFF'><i><b> TEXT1 </b></i></font><br/>"
MsgBody + "<font size='2' color='#000000'><i><b> NAME2: </b></i></font>"
MsgBody + "<font size='2' color='#FFFFFF'><i><b> TEXT2 </b></i></font><br/>"
MsgBody + "<font size='2' color='#000000'><i><b> NAME3: </b></i></font>"
MsgBody + "<font size='2' color='#FFFFFF'><i><b> TEXT3 </b></i></font><br/></div>"
; """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Text ...
MsgBody + "<font size='2' color='#000000'><i><b>" + "owiefwehuiuyuiyiuuiyiuHGUIUHIUIHUIHГШНРПГШЕКВАНЩОШОШЩОшщущгксвыьдацзщ89е7у90-ш4сждычсагшЭ." + "</b></i></font>"
MsgBody + "<br/>"
MySMTPServer.s = "mail.rambler.ru"
MySMTPPort.l = 587
MailTo.s = "pure-test@rambler.ru"
MailFrom.s = "pure-test@rambler.ru"
Subject.s = "Test (with attachments)"
Username.s = MailFrom
Password.s = "test1234"
Attachment$ = ""; "d:\1.jpg"
If PureSMTP_OpenSMTPConnection(MySMTPServer, MySMTPPort) = #PureSMTP_Ok
PureSMTP_SetXMailer("Testemail")
;PureSMTP_SetContentType("multipart/alternative; charset=UTF-8")
PureSMTP_SetContentType("text/html; charset=windows-1251")
PureSMTP_AddHeader("X-MSMail-Priority", "Normal")
Head$ = "<head><meta http-equiv="+Chr(34)+"Content-Type"+Chr(34)+" content="+Chr(34)+"text/html; charset=windows-1251"+Chr(34)+"></head><body>"
Footer$ = "</div></body></html>"
Message$ + Head$ + MsgBody + Footer$
Status = PureSMTP_SendMail(MailTo, MailFrom, Subject, Message$, Attachment$, Username, Password, "Content-Type: text/html; charset=windows-1251")
If Status = #PureSMTP_Ok
Title$ = "Success"
Msg$ = PureSMTP_GetLastServerMessage()
MessageRequester(Title$, Msg$, #PB_MessageRequester_Ok | #MB_ICONINFORMATION)
Else
Title$ = "Error"
Msg$ = "Sendmail error code: " +Str(Status) + Chr(10) + PureSMTP_GetLastServerMessage()
MessageRequester(Title$, Msg$, #PB_MessageRequester_Ok | #MB_ICONERROR)
EndIf
Else
Title$ = "Error"
Msg$ = "OpenSMTP error: " + Chr(10) + PureSMTP_GetLastServerMessage()
MessageRequester(Title$, Msg$, #PB_MessageRequester_Ok | #MB_ICONERROR)
EndIf
.... the body text is in cyrillic (1251).
Thankyou.
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Mon Apr 14, 2014 8:19 pm
by IdeasVacuum
Well, I would say ensure that your output is Unicode, but you must have had a problem with that as you have commented-out that content type. I assume you mean that without an attachment, the code works fine? I just tried to test it in PB4.61 and get an error, but that might have something to do with Avast AV not liking PB4.61.
I don't think you can go far with PureSMTP, it's not supported for PB5.22 and gnozal has been away from the forum for some time now...... have you tried an alternative?
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Mon Apr 14, 2014 8:28 pm
by ruslanx
IdeasVacuum wrote:Well, I would say ensure that your output is Unicode, but you must have had a problem with that as you have commented-out that content type. I assume you mean that without an attachment, the code works fine? I just tried to test it in PB4.61 and get an error, but that might have something to do with Avast AV not liking PB4.61.
I don't think you can go far with PureSMTP, it's not supported for PB5.22 and gnozal has been away from the forum for some time now...... have you tried an alternative?
can suggest me some a good mail library ... ... ?
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Mon Apr 14, 2014 8:38 pm
by IdeasVacuum
Re: PureSMTP library : mail & attachments (AUTH supported)
Posted: Mon Apr 14, 2014 8:41 pm
by ruslanx
thank you .. i'll try.
UPD: thank you .. work now perfect

.