Coder Social home page Coder Social logo

Comments (11)

karastojko avatar karastojko commented on May 28, 2024

Here is an example which is similar to yours:

mailio::message msg;
msg.from(mailio::mail_address("mailio", "[email protected]"));
msg.add_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.add_cc_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.add_bcc_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.subject("issue120");
msg.content_transfer_encoding(mailio::mime::content_transfer_encoding_t::QUOTED_PRINTABLE);
msg.content_type(mailio::mime::media_type_t::TEXT, "plain", "gb2312");
msg.content("issue120");
smtps conn("smtp.mailio.dev", 465);
conn.authenticate("[email protected]", "***", smtps::auth_method_t::LOGIN);
conn.submit(msg);

I do not have any segmentation faults on Ubuntu/Gcc. Can you confirm that this simplified example works in your case? Also take care that you are using the correct port number which requires SSL immediately, not the START TLS port.

from mailio.

UnknownObject000 avatar UnknownObject000 commented on May 28, 2024

Here is an example which is similar to yours:

mailio::message msg;
msg.from(mailio::mail_address("mailio", "[email protected]"));
msg.add_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.add_cc_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.add_bcc_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.subject("issue120");
msg.content_transfer_encoding(mailio::mime::content_transfer_encoding_t::QUOTED_PRINTABLE);
msg.content_type(mailio::mime::media_type_t::TEXT, "plain", "gb2312");
msg.content("issue120");
smtps conn("smtp.mailio.dev", 465);
conn.authenticate("[email protected]", "***", smtps::auth_method_t::LOGIN);
conn.submit(msg);

I do not have any segmentation faults on Ubuntu/Gcc. Can you confirm that this simplified example works in your case? Also take care that you are using the correct port number which requires SSL immediately, not the START TLS port.

This example runs fine.
I'm using a 163.com mailbox and the same 465 port, it works fine on windows.

from mailio.

karastojko avatar karastojko commented on May 28, 2024

Did you try the port 587 with the start tls option?

from mailio.

UnknownObject000 avatar UnknownObject000 commented on May 28, 2024

Did you try the port 587 with the start tls option?

It doesn't work.
I have re-tested the example, it still crashs.

from mailio.

UnknownObject000 avatar UnknownObject000 commented on May 28, 2024

Here is an example which is similar to yours:

mailio::message msg;
msg.from(mailio::mail_address("mailio", "[email protected]"));
msg.add_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.add_cc_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.add_bcc_recipient(mailio::mail_address("mailio", "[email protected]"));
msg.subject("issue120");
msg.content_transfer_encoding(mailio::mime::content_transfer_encoding_t::QUOTED_PRINTABLE);
msg.content_type(mailio::mime::media_type_t::TEXT, "plain", "gb2312");
msg.content("issue120");
smtps conn("smtp.mailio.dev", 465);
conn.authenticate("[email protected]", "***", smtps::auth_method_t::LOGIN);
conn.submit(msg);

I do not have any segmentation faults on Ubuntu/Gcc. Can you confirm that this simplified example works in your case? Also take care that you are using the correct port number which requires SSL immediately, not the START TLS port.

This example runs fine. I'm using a 163.com mailbox and the same 465 port, it works fine on windows.

This test result is invalidate. I have tested the wrong program by mistake, sorry.

from mailio.

karastojko avatar karastojko commented on May 28, 2024

So, my simplified example crashes too?

from mailio.

UnknownObject000 avatar UnknownObject000 commented on May 28, 2024

So, my simplified.example crashes too?

The example reports this error:

terminate called after throwing an instance of 'mailio::dialog_error'
  what():  Server connecting failed.
Aborted

I changed it to my server setup, it crashed with the same Segmentation fault error.

from mailio.

UnknownObject000 avatar UnknownObject000 commented on May 28, 2024

Another whield thing is when I created a new program like this

#include <iostream>
#include <mailio/smtp.hpp>
#include <mailio/message.hpp>

int main()
{
	mailio::message msg;
	msg.from(mailio::mail_address("mailio", "[email protected]"));
	msg.add_recipient(mailio::mail_address("mailio", "[email protected]"));
	msg.add_cc_recipient(mailio::mail_address("mailio", "[email protected]"));
	msg.add_bcc_recipient(mailio::mail_address("mailio", "[email protected]"));
	msg.subject("issue120");
	msg.content_transfer_encoding(mailio::mime::content_transfer_encoding_t::QUOTED_PRINTABLE);
	msg.content_type(mailio::mime::media_type_t::TEXT, "plain", "gb2312");
	msg.content("issue120");
	mailio::smtps conn("smtp.163.com", 465);	
	conn.authenticate("[email protected]", "xxxxxx", mailio::smtps::auth_method_t::LOGIN);
	conn.submit(msg);
	return 0;
}

it doesn't crash.

from mailio.

karastojko avatar karastojko commented on May 28, 2024

So, when you use the example with your credentials it works, but after your code changes it does not work?

from mailio.

UnknownObject000 avatar UnknownObject000 commented on May 28, 2024

So, when you use the example with your credentials it works, but after your code changes it does not work?

Yes.

from mailio.

karastojko avatar karastojko commented on May 28, 2024

But then it's a problem with your changes, right?

from mailio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.