I get error when i'm trying to send email usin

2019-09-16 05:06发布

When I'm trying to send email using https://sourceforge.net/projects/libquickmail
I get error

Unable to resolve SMTP server host name.

#include "quickmail.h"
#pragma comment(lib, "libquickmaillight.dll.a")

int main()
{
    quickmail_initialize();
    quickmail mailobj = quickmail_create("LOGIN@yandex.ru", "libquickmail test e-mail");
    quickmail_set_body(mailobj, "This is a test e-mail.\nThis mail was sent using libquickmail.");

    const char *errmsg = quickmail_send(mailobj, "smtp.yandex.com", 465, "LOGIN@yandex.ru", "PASSWORD");
    if (errmsg != NULL) {
        fprintf(stderr, "Error sending e-mail: %s\n", errmsg);
    }

    quickmail_destroy(mailobj);
}

Compiler is MSVC14.
What did I do wrong?

标签: c++ email smtp
1条回答
Rolldiameter
2楼-- · 2019-09-16 05:37

Try to use quickmail_send_secure instead of quickmail_send

查看更多
登录 后发表回答