SMTP loses attachments w/ Vista

R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Post by R.F. »

I used to use Luis' SMTP class until I had the need to send over 500 emails per hour with attachments in different formats.

I switched to Funcky SMTP component and it works great, even with servers requiring authentication.
Saludos
R.F.
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Funky

Post by TimStone »

I didn't know that was available anymore, or that it would work with FWH/xHarbour.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Post by R.F. »

You bet, Funcky is now a POWERFUL COM component, you use from (x)Harbour via OLE and works great.

This is a sample:

Code: Select all

  

WITH OBJECT oFunckyMail := TOleAuto():New("FUNCkySMTP")
   :Server := "smtp.google.com" // with auth: user:pass@server"
   :FromName := "Me, myself & I"
   :FromAddress := "me@google.com"
   :Subject := "Mail subjet"
   :Message := "Hey guys! I had a really RAD time making " + CRLF +;
               "the movie and I miss you guys. I am throwing "+ CRLF +;
               "a party this weekend and you are all invited. " + CRLF +;
               "Dont dis me, see ya soon... mua!"
   :ToName := "My best friend"
   :ToAddress := "bestfriend@friendship.com"
   IF :Send()
      MsgInfo("Sucess sending the message")
   ELSE
      MsgStop("Houston, we have a problem..."+CRLF+"Sending a message","Alert!"
   ENDIF
END
Saludos
R.F.
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Funky

Post by TimStone »

Are attachments able to be included ?

I owned Funcky for many years for Clipper. What version is appropriate now for xHarbour ( Builder / xCC compiler ) ?

It looks on their website like they haven't touch it for 7 years.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Re: Funky

Post by R.F. »

TimStone wrote:Are attachments able to be included ?

I owned Funcky for many years for Clipper. What version is appropriate now for xHarbour ( Builder / xCC compiler ) ?

It looks on their website like they haven't touch it for 7 years.

Tim
Of course you can include attachments, any format, any ammount of them:

Code: Select all

WITH OBJECT oSmtp := TOleAuto():New("FUNCkySMTP")

   :Server = "mail.tellurian.net"
   :FromName = "Robert Boyle"
   :FromAddress = "rboyle@tellurian.net"
   :ToName = "Melissa Moorman"
   :ToAddress = "melissa@tellurian.net"
   :Subject = "Check out our new building"
   :Attachments = "D:\Photos\Building\NewOffice.Gif"

   // The following syntax attaches three pictures
   * :Attachments = "NewOffice1.Gif, NewOffice2.Gif, OldOffice.Gif"

   // The following syntax attaches all .Gif files in the folder
   * :Attachments = "D:\Photos\Building\*.Gif"

   // The following syntax attaches all Gifs, Bmps and Jpegs
   * :Attachments = "*.Gif, *.Bmp, *.Jpg"
END
You can send HTML coded body messages, and even you can check if a mail address exists in a server <g>.

Well Dirk Lesko is up and running with the Funcky business, drop a line to him in the www.funcky.com.

You can give a try to funcky with the demo version, I think that SMPT capabilities are included in the demo, be sure to ask for the de COM component (the one of Delphi will work with xHarbour)
Saludos
R.F.
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Version of Funcky

Post by TimStone »

You indicated the Delphi version will work with xHarbour but I assume that means if you are building the Borland version.

I am using xCC/xBuilder which is the Microsoft Compatible version. Usually items built for Borland do not work for xCC.

Is that not correct ?

Also, I was going to email Dirk yesterday but there is no method of communication on the website, nor is his sales link working. Some things require registration but you have to post an existing account for that to work.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Tim,

As it is an OLE component, it doesn't matter if you use Borland or Microsoft. You manage a common OLE interface
regards, saludos

Antonio Linares
www.fivetechsoft.com
R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Re: Version of Funcky

Post by R.F. »

TimStone wrote:You indicated the Delphi version will work with xHarbour but I assume that means if you are building the Borland version.

I am using xCC/xBuilder which is the Microsoft Compatible version. Usually items built for Borland do not work for xCC.
he he he, that's the magic of the COM components, they work with any programming language since they are external DLLs to your program, the only thing you have to do is copy to the windows\system32 folder, and "register" them using regsrv32 funcky.dll and that's all.

As Antonio says, the OLE objects work under any programming language using the TOLEAUTO() class.

TimStone wrote: Also, I was going to email Dirk yesterday but there is no method of communication on the website, nor is his sales link working. Some things require registration but you have to post an existing account for that to work.
Write to: support@funcky.com, Dirk will answer you.
Saludos
R.F.
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

Funcky is a good product, but I would still give OstroSoft a try if all you need is smtp email.

It is free, small, very fast, and always seems to work.
http://www.ostrosoft.com/

If you need a sample let me know.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Gale,

> If you need a sample let me know.

We do appreciate if you could post a sample of its use. Many thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

From the OstroSoft SMTP_Component help file:

Licensing

Non-commercial license free
Unlimited usage for developing non-commercial applications.

Developer license $19.00 (purchase)
For a single programmer to develop and distribute a single commercial application.

Server license $59.00 (purchase)
For use in a commercial application, installed on a single server.

Enterprise license $139.00 (purchase)
For programmers within a company to develop and distribute an unlimited number of commercial applications.


James
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

Code: Select all

function mailtest()
   local oMail
   local cHost          := 'mail.myhost.com'
   local cPopServer     := cHost
   local lNeedsAuth     := .f.
   local nPriority      := 0 // Normal (Default)
   local nSensitivity   := 0 // Normal (Default)
   local nNotify        := 0 // None (Default)
   local lSentOk
   local cSubject
   local cText
   local cSendTo        := 'gale.ford@wwrowland.com,help.desk@wwrowland.com'
   local cMailFrom      := 'me@myhost.com'

   oMail := CreateObject("OSSMTP.SMTPSession")
   oMail:Server := cHost
   oMail:RaiseError := .f.

   if lNeedsAuth
      oMail:AuthenticationType := 2
      oMail:Password    := 'password'
      oMail:Username    := 'administrator@myhost.com'
      oMail:ReplyTo     := 'me@myhost.com"
      oMail:POPServer   := cPopServer
   else
      oMail:AuthenticationType := 0  // 0 = no authentication
   endif
   oMail:Importance  := nPriority
   oMail:Sensitivity := nSensitivity

   // Needs comma seperator so if someone used semicolon change them to commas
   oMail:SendTo := trim(strtran( cSendTo, ';', ',' ))
   oMail:MailFrom := cMailFrom

   oMail:MessageSubject := 'My test subject'
   oMail:MessageText := 'Body of email.'

   // Attachements *********************************
   aFiles := { 'c:\autoexec.bat', 'c:\config.sys' }

   for nCounter := 1 to len( aFiles )
      oAttachment := CreateObject("OSSMTP.Attachment")
      oAttachment:FilePath = aFiles[ nCounter ]
      oAttachment:AttachmentName = cFileNoPath( aFiles[ nCounter ] )
      if file( aFiles[ nCounter ] )
         oMail:Attachments:add( oAttachment )
      endif
   next
   // Attachements *********************************

   oMail:SendEmail()
   if upper( oMail:Status ) = 'ERROR'
      lSentOk := .t.
   else
      lSentOk := .f.
   endif
   oMail := nil
return( lSentOk )

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Gale,

Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Interesting

Post by TimStone »

Gale,

I tried the straight mailtest( ) and it worked, so I then cut it into the program I am working with and at first I thought it wasn't working, but then a long time later I found that the emails finally came through. So, that could be a server issue and I'll check on that later.

I did note that you put in the code that if the oMail:status = "ERROR" then you flag the email successful, and if ERROR is not returned you flag it unsuccessful. That puzzled me so I looked at the value of the status return and it said Error 11004:Valid name, no data record of requested type" Any thoughts on what this all means ?

Thanks

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

You are right, the logic was broken when I cleaned up the code to make a test routine.

The error appears to be a winsock/socket error.
I found the explanation below on the internet.

Socket Error 11004 - Valid DNS Name - No data record of requested type

Socket Error 11004 means that the DNS server which POP3 is talking to does not have a record of the appropriate type for the computer name which it was looking up.
DNS supports many different types of data record -

'A' records contain the IP address for a particular host name
'MX' records contain the mail server for a particular host name/domain name
'NS' records contain the DNS servers which hold authoritative information for a particular host name
etc
An error 11004 can happen if, for instance, when you do a DNS lookup for a POP3 server at 'myisp.com', but the DNS server only holds an NS record or an MX record, but not an A record. This can happen if the DNS server is currently incorrectly configured (check with your ISP, or whoever is running the DNS server you are using) or because you should be using a different computer name (eg 'pop3.myisp.com') which would have an A record defined.
In some cases it can also happen because you are using the incorrect DNS server addresses (eg using the DNS servers of one ISP when you are dialing into a second ISP)
Post Reply