Transmission of data from MEGA 2560 to Xstream PKG -RS232 via MAX232

Hello,
I would like to ask regarding the program used to transmit the data from mega to my Xstream PKG -Rs232 modem.
I have to a max232 circuit to do the conversion to rs 232 mode. I made Serial1 my RX TX transmission port and initiated it at the start of the program.
However when i call the function Serial1.write(valueX) where valueX is a variable i have, my modem on the other side fails to receive the data sent by this modem connected to the max232 and then to my mega. I have done a range test and it is within range. Can someone tell me if it is actually my program that went wrong or its just the modem having problems?

Can someone tell me if it is actually my program that went wrong or its just the modem having problems?

Yes. It must be one or the other (unless its both).