Skip to content
Init is coming / May 19 - 23
Back

[SOLVED] SMTP2Go Test fails

  • 0
  • Tools
Drake
6 Oct, 2023, 04:05

You weren't running the docker container?

TL;DR
Issue: SMTP2Go Test fails Solution: - Check the result message, assertion check, and result message used for comparison in the code. - Try testing with a different network or check if there is an issue with the ISP. - Verify if the SMTP credentials are correct. - Test the SMTP settings using a mail client or download a tool. - Ensure that telnet and openssl are installed on the machine. - Test the code in a docker container. - Manually test the code in a docker container using the provided command. - Make sure to set the environment variable when testing manually. - Edit the file if needed. -
ayaan49
6 Oct, 2023, 04:06

Ok. I will edit the file

Drake
6 Oct, 2023, 04:06

You ran PHP unit from your host machine?

ayaan49
6 Oct, 2023, 04:06

No no. When my testing failed in docker container I tried testing it in my local machine.

ayaan49
6 Oct, 2023, 04:07

Yes when testing manually.

Drake
6 Oct, 2023, 04:08

You can't do this because the environment variable wouldn't be set

ayaan49
6 Oct, 2023, 04:08

In my docker container after running the container. I used this command for testing docker exec -it messaging-tests-1 ./vendor/bin/phpunit tests/e2e/Email/Smtp2goTest.php

ayaan49
6 Oct, 2023, 04:09

Oh I see. Then how can we test it manually?

Drake
6 Oct, 2023, 04:09

If you're testing your code, the best thing to do is test it in docker.

Drake
6 Oct, 2023, 04:10

But what you should do before that is make sure the values you have are correct

Drake
6 Oct, 2023, 04:11

Do you have telnet and openssl on your machine?

ayaan49
6 Oct, 2023, 04:13

I understand. It failed there hence I tried testing it that way.

ayaan49
6 Oct, 2023, 04:14

No I don't. Should I install it?

Drake
6 Oct, 2023, 04:16

Eh I dunno. Find some way to test the SMTP settings. Maybe use some mail client or download some tool

ayaan49
6 Oct, 2023, 04:19

Ok sure. So my code didn't have any problem? It's only the SMTP credentials ?

Drake
6 Oct, 2023, 04:21

I still think it's a problem with your ISP

ayaan49
6 Oct, 2023, 04:22

I see. I will try using some other network then.

ayaan49
7 Oct, 2023, 11:21

Hey @Steven , I just tested my code again using docker compose and while the test email is being successfully sent from my SMT2GO account I am getting error from my php code. What is the reason?

ayaan49
7 Oct, 2023, 11:21
Drake
7 Oct, 2023, 14:55

Look closely at the message and look closely at the test

ayaan49
7 Oct, 2023, 16:19

@Steven I tried identifying the problem, but I am not finding any solution. I don't understand why the test is failing when the email is being sent!

darShan
7 Oct, 2023, 16:44

check for a few things:

  1. the result message you are returning after send op.
  2. the assertion check you are validating against the result
  3. the result message you used for comparison

these pointers should be enough i guess.

ayaan49
9 Oct, 2023, 06:37

Please close this issue. I have solved it. @Steven

Drake
9 Oct, 2023, 16:26

[SOLVED] SMTP2Go Test fails

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more