• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

php smtp ssl html mail not working

 
Ranch Hand
Posts: 42
1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone please advise I already looked online and tried everything I can think of my I am only getting plain text email...

Email part is working is only the HTML stuff not I get the $body (message) in raw code rather than html format.

Here is my code:


 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ricardo Wagemaker wrote:Email part is working is only the HTML stuff not I get the $body (message) in raw code rather than html format.


I use this code to set the required mail headersAlthough it should not make a difference (as headers are normally case insensitive), it might be Content-Type (with upper case T).

Hope it helps!
Kind regards,
Roel
 
Ricardo Wagemaker
Ranch Hand
Posts: 42
1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thnk you for your advice Roel De Nijs but it has not worked, I just don't get it as it should all work.

I got it to work with a gmail / tls sample I found online but I do not want to use gmail as i want to use my own mail server using ssl.

Many Thanks I will continue trying :-)
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The host doesn't usually start with "ssl://".

Mail servers usually use SMTP or POP3 or the like. For secure SMTP the protocol is SMTPS (smtp over ssl). The port 465 seems right for smtps.

Since you using Mail.php which may look similar to the PHPMailer class here

Link below may be helpful.

http://stackoverflow.com/questions/5335273/how-to-send-an-email-using-php
 
Ricardo Wagemaker
Ranch Hand
Posts: 42
1
Eclipse IDE Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:The host doesn't usually start with "ssl://".

Mail servers usually use SMTP or POP3 or the like. For secure SMTP the protocol is SMTPS (smtp over ssl). The port 465 seems right for smtps.

Since you using Mail.php which may look similar to the PHPMailer class here

Link below may be helpful.

http://stackoverflow.com/questions/5335273/how-to-send-an-email-using-php




Hi K. Tsang,

Sending the email was not the problem and my host does start with ssl as it's (Secure Sockets Layer) configured and that part always worked it was only the HTML format that was not working.

But now all fixed as I modified the $headers and it all works.

FROM:


TO




Looks like the "rn" for new line is required, but don't ask me why it just works now :-)

 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ricardo Wagemaker wrote:Looks like the "rn" for new line is required, but don't ask me why it just works now :-)


Glad to hear you were able to solve your issue.

Thanks for coming back and sharing your solution. That might be (very) helpful for other ranchers Have a cow!
reply
    Bookmark Topic Watch Topic
  • New Topic