Email body disappears with attachments. It wasn't me!

Just starting out? Need help? Post your questions and find answers here.
Pud
User
User
Posts: 28
Joined: Mon Dec 28, 2009 2:23 am

Email body disappears with attachments. It wasn't me!

Post by Pud »

A few simple lines of code to send an email.
If I add an attachement the body is ignored.
If I remove the attachement the body is ok

Is this correct?

Cheers.
Last edited by Pud on Sat Apr 22, 2017 11:04 pm, edited 1 time in total.
Pud
User
User
Posts: 28
Joined: Mon Dec 28, 2009 2:23 am

Re: Is it me?

Post by Pud »

Code: Select all

;With some further testing using PB 5.60

InitNetwork()
Procedure mail1() 
          
          CreateMail(0,myemailaddress,"Some subject")   
          SetMailBody(0,"Test Body")
           ;AddMailAttachment(0,"JPG","m:\me.jpg")              
          AddMailRecipient(0,myemailaddress,#PB_Mail_To)  
          SendMail(0,myserver,25,0,myusername,mypassword)
          FreeMail(0)

EndProcedure
mail1()

;The body text is sent ok. 

Procedure mail2() 
          
          CreateMail(0,myemailaddress,"Some subject")   
          SetMailBody(0,"Test Body")
          AddMailAttachment(0,"JPG","m:\me.jpg")              
          AddMailRecipient(0,myemailaddress,#PB_Mail_To)  
          SendMail(0,myserver,25,0,myusername,mypassword)
          FreeMail(0)

EndProcedure
mail2()

;The body text is ignored


;Works as expected with PB 5.24
_____________________________________________
Code tags added
11.04.2017
RSBasic
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Is it me?

Post by Sicro »

It is a already reported bug in PB:
http://www.purebasic.fr/english/viewtop ... =4&t=65423

Please set a better thread title. "Is it me?" tells nothing about the content of the thread.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Pud
User
User
Posts: 28
Joined: Mon Dec 28, 2009 2:23 am

Re: Is it me?

Post by Pud »

A workaround is to add a CRLF at the beginning of the body text. This works for me.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Is it me?

Post by IdeasVacuum »

A workaround is to add a CRLF at the beginning of the body text. This works for me.
That's useful to know Pud, thanks.

Please set a better thread title. "Is it me?" tells nothing about the content of the thread.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Pud
User
User
Posts: 28
Joined: Mon Dec 28, 2009 2:23 am

Re: Is it me?

Post by Pud »

IdeasVacuum wrote:
A workaround is to add a CRLF at the beginning of the body text. This works for me.
That's useful to know Pud, thanks.

Please set a better thread title. "Is it me?" tells nothing about the content of the thread.
Ya, I’ve already been told off for that :oops:

It’s just that the other couple of dozen ‘bugs’ I’ve found turned out to be me being totally stupid and ‘code blind’. I couldn’t believe I’d found a real bug.
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Is it me?

Post by Demivec »

Pud wrote:
IdeasVacuum wrote:
A workaround is to add a CRLF at the beginning of the body text. This works for me.
That's useful to know Pud, thanks.

Please set a better thread title. "Is it me?" tells nothing about the content of the thread.
Ya, I’ve already been told off for that :oops:

It’s just that the other couple of dozen ‘bugs’ I’ve found turned out to be me being totally stupid and ‘code blind’. I couldn’t believe I’d found a real bug.
I don't mean to be harsh but the repetition comes from the title remaining unchanged. You just have to edit the title in the first message of the thread to correct it. :wink:
Pud
User
User
Posts: 28
Joined: Mon Dec 28, 2009 2:23 am

Re: Email body disappears with attachments. It wasn't me!

Post by Pud »

I didn't know you could do that. Fixed.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Email body disappears with attachments. It wasn't me!

Post by IdeasVacuum »

:mrgreen: Your discovery that a simple #CRLF$ makes the difference will be music to the ears for a lot of people.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply